Problem/Motivation

addClass could be used with just one .addClass
ex:
<div{{ attributes.addClass(classes,'field__items') }}>

Because the field template is used so often, this could be a performance hit (two calls to addClass() vs. one).

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because it's a performance increase and nothing is broken.
Issue priority Normal, nothing is broken.
Prioritized changes The main goal of this issue is performance.
Disruption No disruption at all.

Proposed resolution

FIx it.

Remaining tasks

None

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mortendk created an issue. See original summary.

mortendk’s picture

and fixed the spacing

star-szr’s picture

Title: merge double addClasses in field into one » Remove double addClass() calls in Classy's field.html.twig
Category: Bug report » Task
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Thanks, added beta eval and updated IS. Good to go!

davidhernandez’s picture

+1

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed f8fbcbe and pushed to 8.0.x. Thanks!

  • alexpott committed f8fbcbe on 8.0.x
    Issue #2558203 by mortendk: Remove double addClass() calls in Classy's...

Status: Fixed » Closed (fixed)

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