Hide option, still make text available when not displayed

Created on 14 April 2025, about 2 months ago

Problem/Motivation

This recently fixed issue provides a way to hide the entity reference override custom text:
https://www.drupal.org/project/entity_reference_override/issues/3505166 ✨ Option to hide override label Active

This is useful, but the code in EntityReferenceOverrideLabelFormatter.php takes no action for the 'hide' choice:

          case 'hide':
            break;

It would be helpful to at least still have access to that custom text to use developmentally when it is hidden from automatic display.

Proposed resolution

Might it be agreeable to at least add this line to the case statement?

            $elements[$delta]['#entity_reference_override_text'] = $values[$delta]['override'];

Whereas the custom text would still be available in an unused custom property in the render array, so that developers can make use of it as we wish.
I have a use case for this and would love to make use of this module instead of creating a whole new field to hold such text.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States fizcs3 Omaha, Nebraska; USA

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024