- Issue created by @danchadwick
- πΊπΈUnited States danchadwick Boston
Here's a patch created on D10.3, but I suspect it applies fine to 11.x
- π³πΏNew Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.
- πΊπΈUnited States danchadwick Boston
Argh. Apparently core (and maybe contrib) creates attribute array class elements as both strings and arrays, so a cast to (array) is needed. I'd call that a bug, but that's another issue.
Here's a revised patch.
- πΊπΈUnited States smustgrave
thank you for reporting
Fixes should be in MRs vs patches
Also will need a test case to show the problem.
- First commit to issue fork.
- Merge request !10860Issue #3494015 "Link render element overwrites css class" β (Closed) created by vidorado
- πͺπΈSpain vidorado LogroΓ±o (La Rioja)
I've just created a MR and added a Kernel test :)
- πΊπΈUnited States smustgrave
1) Drupal\KernelTests\Core\Render\Element\RenderElementTypesTest::testLink "#type 'link' anchor tag with extra classes in both ['#attributes'] and ['#options']['attributes']" input rendered correctly. Failed asserting that an array is not empty. /builds/issue/drupal-3494015/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php:331 FAILURES! Tests: 5, Assertions: 21, Failures: 1.
Shows test coverage, reviewing that file too looks like a good number of scenarios covered.
Rest of the change appears fine
Not sure if this requires a CR for merging 2 arrays now but will let committer decide.
- π¬π§United Kingdom longwave UK
While this is a bug fix it's also a minor behaviour change as mentioned in the IS, so only committing this to 11.x to avoid breaking existing sites in a patch release. The MR also doesn't apply cleanly to 10.5.x so only committing this to 11.x; if you think this is worthwhile to backport please reopen with an MR against 10.5.x.
Committed ee78cfa and pushed to 11.x. Thanks!
-
longwave β
committed ee78cfa7 on 11.x
Issue #3494015 by vidorado, danchadwick, smustgrave: Link render element...
-
longwave β
committed ee78cfa7 on 11.x
- Status changed to Fixed
28 days ago 1:08pm 5 March 2025 Automatically closed - issue fixed for 2 weeks with no activity.