[2.0.0-alpha1] Source plugins should also provide SourceField value

Created on 14 February 2023, almost 2 years ago
Updated 14 March 2024, 8 months ago

Problem/Motivation

We currently have UiPatternsSource plugins that define the available SourceField for a given need (using tags). Those plugins only generate the list of the available fields but never their values. The values recovery is hardcoded where those plugins are used (FieldGroupFormatter, FieldFormatter, ViewsRow, etc.). This absolutely negates the interest of having plugins to extend the available options.

For example, in Allow to get the label from the field_display_label module Needs review we would like to integrate with a contrib modules that defines a field label dedicated to display. With an appropriate implementation, this contrib module should provide its own Source plugin to declare the new field then return its value if it's used in any pattern.

It would be the same if someone would like to add a custom value based on whatever logic they want. It's not possible without altering the contrib code.

Proposed resolution

Refactor the Source plugins so they are called to provide the field value too.
Try to find a way to prevent BC break.

Remaining tasks

Implement without breaking tests
Extend test coverage with some custom Source plugin implementation

User interface changes

None

API changes

Source plugins will have to implement a new method.

Data model changes

None

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇷France duaelfr Montpellier, France

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024