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

Comments

joelpittet created an issue. See original summary.

joelpittet’s picture

Status: Active » Needs review
FileSize
9.67 KB

Let's see if this breaks anything:)

Status: Needs review » Needs work

The last submitted patch, 2: allow_link_and-2615660-2.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
9.75 KB
1.03 KB

Notice fix. Not sure how to fix the mock unit test thing.

Status: Needs review » Needs work

The last submitted patch, 4: allow_link_and-2615660-4.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
4.12 KB
10.84 KB

Using the approch taken in TwigExtension::getLink() for the merging.

Status: Needs review » Needs work

The last submitted patch, 6: allow_link_and-2615660-6.patch, failed testing.

joelpittet’s picture

Kinda annoying to debug these... it looks like test results are XSS admin filtered or strip tags or something because the link tags are gone.

dawehner’s picture

Mhhh, 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.

joelpittet’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue tags: -Needs tests

Has 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.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.