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

BLT-4192: Fix validate twig syntax with Drupal 9. #4193

Merged
merged 1 commit into from
Jun 22, 2020

Conversation

agiraud85
Copy link
Contributor

Fixes #4192

Changes proposed

The syntax in /core/lib/Drupal/Core/Template/TwigExtension.php has changed and the new filters are now declared with "new TwigFilter" instead of "new \Twig_SimpleFilter". Same thing for TwigFunction.
We need to update the file /src/Robo/Commands/Validate/TwigCommand.php to reflect those changes.

Steps to replicate the issue

  1. Install new BLT 12 project with Drupal 9
  2. Add custom twig templates to use core twig filters
  3. Run blt validate:twig function.

Previous (bad) behavior, before applying PR

The TwigCommand.php is searching for "new \Twig_SimpleFilter" in Drupal core to add exception but these filters don't exist anymore.

Expected behavior, after applying PR and re-running test steps

Run the command blt validate:twig and it should contain valid syntax.

@danepowell
Copy link
Contributor

Thanks a lot for the PR!

@danepowell danepowell merged commit 6011488 into acquia:12.x Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

validate:twig not working anymore with core twig filter
2 participants