Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A PHP notice occurs when rememberState is set to false #934

Closed
petaak opened this issue Dec 8, 2020 · 2 comments
Closed

A PHP notice occurs when rememberState is set to false #934

petaak opened this issue Dec 8, 2020 · 2 comments

Comments

@petaak
Copy link

petaak commented Dec 8, 2020

After updating to the new version (v6.5.0) I'm getting a PHP notice when rememberState is set to false

My code:

    public function createComponentGrid(): DataGrid
    {
        $grid = new DataGrid();

        $grid->setDataSource([
            ['id' => 1, 'name' => 'John', 'surname' => 'Doe'],
            ['id' => 2, 'name' => 'Jane', 'surname' => 'Smith'],
        ]);

        $grid->addColumnText('name', 'Name')->setSortable();
        $grid->addColumnText('surname', 'Surname')->setSortable();

        $grid->setRememberState(false);

        return $grid;
    }

ends up with a notice "Trying to access array offset on value of type null" on this line https://github.com/contributte/datagrid/blob/v6.5.0/src/DataGrid.php#L2779

@martinvenus
Copy link

If necessary I can support solving this issue by some $. Just give me know. Thanks.

@paveljanda
Copy link
Member

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

No branches or pull requests

3 participants