Problem/Motivation

In some cases we need to merge attribute objects in twig.
This is not possible at the moment.

An example of a contrib project suffering of this problem.
#2623702: HTML Attributes not merged properly

Proposed resolution

Review patch

Remaining tasks

/

User interface changes

/

API changes

Minor API addition

Data model changes

/

Comments

aspilicious created an issue. See original summary.

aspilicious’s picture

Status: Active » Needs review
FileSize
2.42 KB
Cottser’s picture

Status: Needs review » Closed (duplicate)
joelpittet’s picture

Version: 8.0.x-dev » 8.1.x-dev
Status: Closed (duplicate) » Active

Actually re-opening:) We have a proposal to fix the other in 8.0.x and this can be the 8.1 issue.

joelpittet’s picture

Title: Add a mergeAttributes function » Add a merge() method on Attribute objects
Cottser’s picture

lauriii’s picture

lauriii’s picture

Status: Active » Needs review
FileSize
2.77 KB

Posting latest patch from the other issue

aspilicious’s picture

Status: Needs review » Needs work
       '__toString',
+      'merge',
     ]);

This is not needed and dangerous :)

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.