-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Property access broken in latest update #45233
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
Comments
could you please provide a reproducer? |
I'm experiencing this issue as well. Here is a stack trace. On a form submission with a data class with class members that are type hinted.
|
@that-guy-iain Can you please provide a minimal reproducer project? |
Might be related to #45002 |
@fancyweb so far no. I've tried to but I can't reproduce it so far in my new skeleton. |
I'm having the same problem after upgrade to 6.0.3 |
We cannot fix a problem we cannot reproduce. Please either produce a reproducer as described here or a PR with a failing test case. |
I would be able to provide access to a private repo that has the issue. I just can't seem to reproduce it in a new product. So if that could be of help then someone can message me on the Symfony Slack under @icambridge and I can provide that. |
Please check #45255 and tell us if it fixes the issue you're having. |
… parent class (filiplikavcan) This PR was merged into the 4.4 branch. Discussion ---------- [PropertyAccess] Fix handling of uninitialized property of parent class | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | Tickets | Fix #45233 | New feature? | no | Deprecations? | no | License | MIT [This fix](27d5edf#r795578649) introduced a new bug: ```php class X { public int $a; } class Y extends X { } (new Y)->a; // PropertyAccessor expects: Typed property Y::$a must not be accessed before initialization // Actual exception message: Typed property X::$a must not be accessed before initialization ``` This prevents from throwing `AccessException` exception and it bubbles up and causes this exception after form submit: "Typed property X::$a must not be accessed before initialization" which would otherwise be handled by PropertyPathAccessor: ```php } catch (PropertyAccessException $e) { // ... return null; } ``` Commits ------- 5cd10b0 [PropertyAccess] Fix handling of uninitialized property of parent class
@nicolas-grekas I'm assuming the line 439 in that PR is to be applied to 431 in 6.0.3? |
Thanks @derrabus and @nicolas-grekas. This fix worked for me. @that-guy-iain: Yes, it's applied to 430 and 431 in 6.0.3 |
Symfony version(s) affected
5.4.3, 6.0.3
Description
I need to fix my dep to
"symfony/property-access": "5.4.2"
(or 6.0.2) after yesterday updates.Otherwise, I get plenty of
Typed property $foo must not be accessed before initialization
How to reproduce
See above
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: