Problem/Motivation

The comparison table has "Remove from the list" links built by calling getLink(...)->toString(). This causes the link to be generated and rendered up front. It also makes it hard to alter in hook_entity_comparison_rows_alter. Using toRenderable allows adding classes to the generated link and delays URL generation.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Status: Active » Needs review

With this MR proposal, I was able to use the alter and add styling like

$rows[0][$key]['data']['#attributes']['class'][] = 'text-blue-400';
heddn’s picture

Status: Needs review » Reviewed & tested by the community

Seem good enough to me.

  • lobodacyril committed 85d1a1b on 8.x-2.x
    Issue #3190911 by mglaman: Use toRenderable on the Link object instead...
lobodakyrylo’s picture

Status: Reviewed & tested by the community » Fixed
lobodakyrylo’s picture

Status: Fixed » Closed (fixed)