Skip to content

[ExpressionLanguage] #[Assert\Expression] validation fails with "Undefined array key" warning. #48706

Closed
@ghost

Description

Symfony version(s) affected

6.2.2

Description

When using the version 6.2.2 of symfony/expression-language the #[Assert\Expression] validation constraint is broken and validation always fails. The issue does appear only in production environment.

How to reproduce

  • Setup reproducer app:
git clone https://github.com/jbroutier/sf-expression-language-issue
cd sf-expression-language-issue
composer install
php -S 0.0.0.0:8080 -t public
  • Open browser and navigate to http://127.0.0.1:8080.
  • Fill the form and submit it, validation passes.
  • Fill the form again and submit it, validation fails. Removing the cache fixes the issue for another round.

Possible Solution

Likely caused by #48559. As a temporary workaround, reverting symfony/expression-language to version 6.2.0 fixes the issue.

Additional Context

PHP error log:
[Mon Dec 19 16:21:34 2022] PHP Warning: Undefined array key "nodes" in /usr/development/skeleton/vendor/symfony/expression-language/Node/GetAttrNode.php on line 158
[Mon Dec 19 16:21:34 2022] PHP Warning: Undefined array key "attributes" in /usr/development/skeleton/vendor/symfony/expression-language/Node/GetAttrNode.php on line 159
[Mon Dec 19 16:21:34 2022] PHP Warning: Undefined array key "nodes" in /usr/development/skeleton/vendor/symfony/expression-language/Node/GetAttrNode.php on line 158
[Mon Dec 19 16:21:34 2022] PHP Warning: Undefined array key "attributes" in /usr/development/skeleton/vendor/symfony/expression-language/Node/GetAttrNode.php on line 159
[Mon Dec 19 16:21:34 2022] PHP Warning: Undefined array key "type" in /usr/development/skeleton/vendor/symfony/expression-language/Node/GetAttrNode.php on line 70
[Mon Dec 19 16:21:34 2022] PHP Warning: Undefined array key "type" in /usr/development/skeleton/vendor/symfony/expression-language/Node/GetAttrNode.php on line 70

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions