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

Fixed notices in Grid/Column/Column #1047

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Conversation

unrealevil
Copy link

Fixed notice: "Trying to access array offset on value of type null" in Grid/Column/Column.php on PHP 7.4

Fixed notice: Trying to access array offset on value of type null at Grid/Column/Column.php:531
@Bomere
Copy link

Bomere commented Mar 17, 2020

Very usefull!
I use a lot of grid in my project and our server run with PHP7.4. The notice isn't throw into production env. but it's not possible to access grid in dev env. ... It's boring.

👍 👍

Copy link
Collaborator

@npotier npotier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me @romainguerrero

@DonCallisto
Copy link
Member

It seems to be good but I suspect that's "hiding" some kind of other issue that should be investigated. As $data seems to be treated always as an array, why there's a case where it has no value?
Just wondering if this issue should be tackled by understanding why such null value arise.

@npotier
Copy link
Collaborator

npotier commented Apr 1, 2020

@DonCallisto I agree with you. The source code shows that $data is not initialized in the constructor, but only in the setData method. Therefore, I guess that if you call getData before setData, the warning occurs.

To be completly safe, I guess that $data should be initialized in the constructor as it is actually done in the setData method:

$this->data = ['operator' => $this->getDefaultOperator(), 'from' => static::DEFAULT_VALUE, 'to' => static::DEFAULT_VALUE];

but I don't know if creates side effects somewhere else.

@vialcollet
Copy link

Any news on this?
This is preventing from running php7.4.
Thanks!

@manuel-garcia-dkt
Copy link

Any updates on this? As @vialcollet says, this is broken on dev environment for php 7.4

@kaamaa
Copy link

kaamaa commented Apr 16, 2021

Any updates on this? As @vialcollet says, this is broken on dev environment for php 7.4

yes, you can find he required changes here:

https://github.com/kaamaa/APYDataGridBundle

@manuel-garcia-dkt
Copy link

Any updates on this? As @vialcollet says, this is broken on dev environment for php 7.4

yes, you can find he required changes here:

https://github.com/kaamaa/APYDataGridBundle

Thanks for repply! There is another aditional change than blocks.twig?
kaamaa@6128364

@kaamaa
Copy link

kaamaa commented Apr 16, 2021

Thanks for repply! There is another aditional change than blocks.twig?
kaamaa@6128364

Yes, it supports symphony 5.2

link911 added a commit to link911/APYDataGridBundle that referenced this pull request Nov 4, 2021
`{% set op = column.data.operator is defined ? column.data.operator : column.defaultOperator %}` call directly Column::getData().
Related to APY#1047 but not fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants