- Issue created by @duaelfr
- Merge request !12831Issue #3537801 by duaelfr: Fatal error when using a Twig defined variable as Attribute value → (Closed) created by duaelfr
- 🇺🇸United States smustgrave
What happens though if you add markup like
{% set test_attr %} <p>This is a test<p> {% endset %}
- 🇫🇷France duaelfr Montpellier, France
The Attribute object already filters HTML from values so that shouldn't be an issue. I believe this is covered by some tests.
- 🇺🇸United States smustgrave
Gotcha, then seems like a fine change. The test only run is also showing https://git.drupalcode.org/issue/drupal-3537801/-/jobs/5996750
1) Drupal\Tests\Core\Template\AttributeTest::testAttributeValues with data set "twig-markup" ([Twig\Markup Object (...)], ' title="foo"') Error: Call to undefined method Twig\Markup::render() /builds/issue/drupal-3537801/core/lib/Drupal/Core/Template/Attribute.php:329 /builds/issue/drupal-3537801/core/tests/Drupal/Tests/Core/Template/AttributeTest.php:376 ERRORS!
- 🇮🇳India rajesh.vishwakarma
It working fine after adding the patch. I tested with Drupal 11.2.2
RTBC +1 The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.