List Item Label not working for fields with the same name as base_field definition

Created on 12 August 2021, over 3 years ago
Updated 12 February 2024, 10 months ago

Problem/Motivation

"List Item Label" option is not working for fields with the same name as base_field definition.

Steps to reproduce

Create a custom field with the machine name "field_type" as a list text with some options on a node type.
Add it to the search index.
Create a facet for it and check the option "List Item Label"
The label is never shown, always the key.
This is because the "ListItemProcessor" checks the field_identifier against the nodes base_field definitions. This is not correct because the field_identifier can be the same as the base_field definitions.

Proposed resolution

Only check the base field definitions as the last fallback instead of the first step.
This is not the best solution, but it does provide an easy and quick fix. Best solution would be te properly fetch the field machine name and try and load the field.

Remaining tasks

Review and commit patch

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Active

Version

1.8

Component

Code

Created by

🇧🇪Belgium weseze

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇿Czech Republic Bohus Ulrych Pilsen (Czechia)

    Hi all,
    I had same problem.
    I have node field "Documentation Type", in search index I set machine name to "type". In facet I enabled "List item label", but still keys were displayed instead of labels.
    This patch fixed it. Applied on latest 3.0.x-dev (updated 10 Nov 2023 at 13:56 UTC) version.

Production build 0.71.5 2024