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

[ExpressionLanguage] Fix BC of cached SerializedParsedExpression containing GetAttrNode #48559

Merged
merged 1 commit into from Dec 13, 2022

Conversation

fancyweb
Copy link
Contributor

@fancyweb fancyweb commented Dec 9, 2022

Q A
Branch? 6.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets #48543
License MIT
Doc PR -

Ref #47058

GetAttrNode can be serialized and cached through SerializedParsedExpression.

@fsevestre Can you try this small patch plz?


public function __unserialize(array $data): void
{
$this->nodes = $data['nodes'];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nicolas-grekas I'm wondering if there's a way to just call the "default PHP unserialization" in one line and then add the extra checks?

Copy link
Member

Choose a reason for hiding this comment

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

use __wakeup instead?

Copy link
Member

Choose a reason for hiding this comment

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

on a closer look, the code is correct (except for isNullCoalesce which has never been part of any serialized payloads)

@fsevestre
Copy link
Contributor

Hello, I can confirm that with the current patch my error is gone 👍

@nicolas-grekas
Copy link
Member

Thank you @fancyweb.

@nicolas-grekas nicolas-grekas merged commit 170c5b2 into symfony:6.2 Dec 13, 2022
6 of 9 checks passed
@fabpot fabpot mentioned this pull request Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants