Problem/Motivation
Currently the following deprecation notice is thrown for ui_patterns code:
Since twig/twig 3.12: Not passing an instance of "TwigFunction" when creating a "_ui_patterns_preprocess_props" function of type "Twig\Node\Expression\FunctionExpression" is deprecated.
See also https://git.drupalcode.org/project/drupal/-/commit/f38c94f9b624a6828313c... for how this issue was fixed for SDC's ComponentNodeVisitor.
Steps to reproduce
- Perform UI patterns related kernel tests with Symfony deprecation helper enabled and see the above mentioned deprecation notice
Proposed resolution
- Use
TwigFunctioninstead of passing a string toFunctionExpression
Remaining tasks
Create issue fork an MR to fix this issue
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Issue fork ui_patterns-3483939
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
hctomSee the associated issue fork and MR for the fix.
Comment #4
hctomTypos and issue summary update
Comment #5
pdureau commentedThanks a lot.
Drupal Core's Twig dependency:
At the 2.0.0 release, we will support Drupal 10.3, 11.0 & 11.1. So we need to be careful about nor breaking stuff.
Target: Beta5. But we can target Beta4 (released this week) if we are sure backward dependency.
Comment #6
hctomJust checked
drupal/core-recommendedfor the recommended Twig versions, and from10.3.4on,twig/twigis required with~3.14.0(https://github.com/drupal/core-recommended/blob/10.3.4/composer.json).Ist it worth to support
10.3.xcore versions below10.3.4or should thecore_version_requirementof UI Patterns be changed to^10.3.4 || ^11instead?Comment #7
pdureau commentedComment #8
hctomAs discussed with @pdureau in Slack, increasing the core version requirement for Drupal 10 to
^10.3.4is enough, because the latest10.3.xversion will be targeted.Issue fork and MR are also updated with the corresponding commit.
Comment #10
pdureau commentedComment #11
pdureau commented