Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Follow-up to #2614628: menu local task and local actions are missing link context variables
Link currently builds up attributes from the Url object. This is counter intuitive since the Url doesn't have attributes, the link does.
Proposed resolution
Let the Link and link generator deal with attributes. Leave the Url options attributes in for BC.
Remaining tasks
Needs tests.
API changes
Link objects can take
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#6 | allow_link_and-2615660-6.patch | 10.84 KB | joelpittet |
#6 | interdiff.txt | 4.12 KB | joelpittet |
#4 | interdiff.txt | 1.03 KB | joelpittet |
#4 | allow_link_and-2615660-4.patch | 9.75 KB | joelpittet |
#2 | allow_link_and-2615660-2.patch | 9.67 KB | joelpittet |
Comments
Comment #2
joelpittetLet's see if this breaks anything:)
Comment #4
joelpittetNotice fix. Not sure how to fix the mock unit test thing.
Comment #6
joelpittetUsing the approch taken in TwigExtension::getLink() for the merging.
Comment #8
joelpittetKinda annoying to debug these... it looks like test results are XSS admin filtered or strip tags or something because the link tags are gone.
Comment #9
dawehnerMhhh, attribute is part of the template subsystem, a link object is more of a generic concept, so yeah I'm not sure at all whether this is a good idea.
Comment #10
joelpittetHas tests, they are just broken. I do think this should be done as it builds up a link tag it should be able to deal with the attributes it needs as well.
Bumping to 8.1.x because it's a feature request.