Select widget: Empty Label configuration

Created on 21 June 2022, over 2 years ago
Updated 20 March 2023, over 1 year ago

Hi there,

Problem/Motivation

I have one field "list (text)" attached to two bundles (e.g. Article, Basic Page) with widget Select. For Basic page I need empty label "- None -" and for this I configured Field setting "Allowed number of values" to "Unlimited" and make this field as not required. For article I need to have label "- Select a value -". So in this case I need to update Field settings and change option "Allowed number of values" to limited 1. But this update will automatically trigger changing field settings for another bundle (basic page), because this setting is responsible for data structure of this field. As a conclusion I cannot manage the empty labels separately for several instances of one field.

Steps to reproduce

  1. Create a field "List (text)"
  2. Add some list options.
  3. Add this field to different bundles (e.g. Article and Basic Page) with Field setting "Allowed number of values" is "Unlimited".
  4. For both field instances we have only two variants of labels "- None -" or no label. This behavior will be reached by managing options limited/unlimited and required/not required for Edit page of field settings.
  5. To get empty label "- Select a value -" change the option "Allowed number of values" in Field settings in one field instance which is automatically trigger changing this in another bundle.

Proposed resolution

Add additional configuration for "Empty label" to "Edit field settings" and add a Widget supports this behavior.

Data model changes

Module config is also will be adjusted to store additional properties. New functionality won't break existed. No hook_update required.

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇧🇾Belarus e.bogatyrev

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.

Production build 0.71.5 2024