Problem/Motivation

The original list of values is getting hidden with only the "other" textfield to being displayed. This issue was introduced in 4.2.1, I suspect accidentally, while trying to fix #3556770: Fix eslint.

Steps to reproduce

Create a list field in a content type and display it using the Select or Other formatter.

Proposed resolution

Replace .replace('other-select', 'other-other') with the original .replace('select', 'other')

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

vensires created an issue. See original summary.

vensires’s picture

Status: Active » Needs review
StatusFileSize
new620 bytes

The MR fixes the issue.
Attaching patch for use in composer-patches directive until this is fixed.

vensires’s picture

There is a small case this change was intended to fix #3171843: Multiple-value checkboxes do not render existing values though I doubt since it was altered in a completely different issue.
In any case, you might want to also check that issue too... just in case!

Thank you!

ivnish’s picture

StatusFileSize
new70.39 KB
new29.63 KB

I fixed this because IMHO, it doesn't work properly. Now with my fix:

screenshot

Your code:

screenshot

vensires’s picture

I think we need more feedback from other users…
The experience I have from my site is not the same you show in your gif.
I will try to reproduce in a simplytest environment next week and come back here.

vensires’s picture

I just tried this in a completely new Drupal 11 installation with nothing else installed but the Standard profile and this module.
I set the "Tags" field of the "Article" content type to use "Select or other" formatter. The rendered widget was this one; only the Other field:

After installing the "cweagans/composer-patches" package and my patch from above, I get the following widget:

In case you need it, I attach my configuration too.

ivnish’s picture

Ok, I understand now. My code fixed the "List" field, but broke Entity reference field. It can affect a lot of existing sites and I think we need to revert my fix. Thanks!

  • ivnish committed 4bba1b7a on 4.x authored by vensires
    fix: #3558004 Multiple-value select list does not render existing values...
ivnish’s picture

Version: 4.2.1 » 4.x-dev
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

vensires’s picture

Title: Multiple-value select list does not render existing values » Multiple-value select list does not render existing values (entity reference field)

Thank you for the quick fix @ivnish

Do we have another issue for the list? This one maybe: #3171843: Multiple-value checkboxes do not render existing values?
So that we continue the discussion there over that topic.

ivnish’s picture

I tested checkboxes, they work fine

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.