Linkit with attributes widget overrides parent options

Created on 8 August 2023, over 1 year ago
Updated 30 August 2024, 3 months ago

Problem/Motivation

The new Linkit (with attributes) widget is so useful, since it combines the features of this module and Linkit , thanks very much!

However, I noticed that when using this widget for linking to a media entity, the link is always rendered in the canonical form /media/[id], even when Linkit's substitution type is set to media, which should result in a link to the media's source file.

Proposed resolution

I found out that the options data-entity-type, data-entity-uuid and data-entity-substitution are missing. The reason seems to be the widget's massageFormValues() method, which overrides that of Linkit's widget, where those options are copied from the attributes key to options.

So doing the same (or similar) in this widget's method should solve the issue.

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇩🇪Germany mrshowerman Munich

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024