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

Add test for setting an empty field's first item to null #279

Closed
wants to merge 1 commit into from

Conversation

mglaman
Copy link
Owner

@mglaman mglaman commented Dec 22, 2021

This verifies a Drupal core bug when processing LinkItemTest

Fixes #228

@mglaman
Copy link
Owner Author

mglaman commented Dec 22, 2021

Screen Shot 2021-12-22 at 3 28 32 PM

This is why it's erroring. PHPStan has held onto the value when it was set to a string.

PHPStan is not aware that the entity property is a FieldItemList which is \ArrayAccess but with magical getters that will return the first value.

@mglaman
Copy link
Owner Author

mglaman commented Dec 22, 2021

The "bug": NodeScopeResolver::processAssignVar thinks the that field value is a string which no longer is a super of \ArrayAccess and it forgets that it is a FieldItemList

@mglaman
Copy link
Owner Author

mglaman commented Feb 14, 2024

Parent issue was closed without this being merged, as it was apparently fixed already.

@mglaman mglaman closed this Feb 14, 2024
@mglaman mglaman deleted the gh228 branch February 14, 2024 02:53
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.

Add test for setting an empty field's first item to null
1 participant