Skip to content

Commit 170c5b2

Browse files
bug #48559 [ExpressionLanguage] Fix BC of cached SerializedParsedExpression containing GetAttrNode (fancyweb)
This PR was merged into the 6.2 branch. Discussion ---------- [ExpressionLanguage] Fix BC of cached SerializedParsedExpression containing GetAttrNode | 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? Commits ------- 6c33582 [ExpressionLanguage] Fix BC of cached SerializedParsedExpression containing GetAttrNode
2 parents 0f5a556 + 6c33582 commit 170c5b2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,15 @@ public function toArray()
149149
return [$this->nodes['node'], '[', $this->nodes['attribute'], ']'];
150150
}
151151
}
152+
153+
/**
154+
* Provides BC with instances serialized before v6.2
155+
*/
156+
public function __unserialize(array $data): void
157+
{
158+
$this->nodes = $data['nodes'];
159+
$this->attributes = $data['attributes'];
160+
$this->attributes['is_null_coalesce'] ??= false;
161+
$this->attributes['is_short_circuited'] ??= $data["\x00Symfony\Component\ExpressionLanguage\Node\GetAttrNode\x00isShortCircuited"] ?? false;
162+
}
152163
}

0 commit comments

Comments
 (0)