Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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

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 nicolas-grekas force-pushed the el/fix-get-attr-node-uns branch from fb817ee to 6c33582 Compare December 13, 2022 15:47
@nicolas-grekas
Copy link
Member

Thank you @fancyweb.

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.

4 participants