Problem/Motivation

$url = \Drupal\Core\Url::fromRoute('<front>', [], ['atttributes' => ['class' => ['foo']]);

/**
 * link(text, url, { 'class': ['bar'] });
 */

This should append a class, not replace the existing foo class.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner created an issue. See original summary.

dawehner’s picture

Status: Active » Needs review
FileSize
1.19 KB
dawehner’s picture

Status: Needs review » Needs work

The last submitted patch, 2: 2847611-2.patch, failed testing.

webflo’s picture

Status: Needs work » Needs review
FileSize
1.98 KB
dan2k3k4’s picture

Status: Needs review » Reviewed & tested by the community

Read through the code, good use of mergeOptions.

Seems to be all good from my side.

tim.plunkett’s picture

Came to review this, already RTBC. +1 from me!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed ba06831 to 8.4.x and 936ca9e to 8.3.x. Thanks!

I thought about the BC impact but the code change shows us that this is changing it to work as intended. And the worst that can happen is an additional classes are added.

  • alexpott committed ba06831 on 8.4.x
    Issue #2847611 by dawehner, webflo: \Drupal\Core\Template\TwigExtension...

  • alexpott committed 936ca9e on 8.3.x
    Issue #2847611 by dawehner, webflo: \Drupal\Core\Template\TwigExtension...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.