Skip to content

[Bug]: List setup save causes error 500 for columns added with the admin.list.extendColumns event #1198

Description

@oriondevelops

Which package is affected?

Core

Version

4.x

What happened?

I added a list column from an extension with the admin.list.extendColumns event. I used the example from the documentation, section "Extending column definitions": https://tastyigniter.com/docs/extend/lists#extending-column-definitions

Steps to reproduce on a fresh install:

  1. Register the event listener from the documentation example:
Event::listen('admin.list.extendColumns', function ($widget) {
    $widget->addColumns([
        'my_column' => [
            'label' => 'My Column',
        ],
    ]);
});
  1. Open the related admin list page. The column shows correctly.
  2. Open the list setup panel. Remove "My Column". Save. The page continues to work.
  3. Open the list setup panel again. Select "My Column". Save.
  4. The save request returns the error. The page then shows error 500 on each load for this admin session. The error is: "Invalid column name used: my_column. Must be included in list columns definition."

What did you expect to happen?

The page loads and shows the saved layout with the extension column.

What browser are you seeing the problem on?

No response

Relevant log output

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions