D10.2, Add Select field Error

Created on 18 December 2023, about 1 year ago
Updated 3 May 2024, 8 months ago

Problem/Motivation

I originally used 10.1.7 to test my new site, but it had problem of installing rules module. Yesterday I updated my core to D2.0, caused more problems. So today I started from scratch, installed D2.0 and redo my site. However, when I add a Select field, I encountered errors.

1. Create a content type;
2. add a field Chapter as Selection List, and then choose list(test);
3. Next page, in the "Allowed Value", type in anything, like test option, when my cursor left the box, there is an error reminder. Under admin/reports/dblog, the error message is:
InvalidArgumentException: The configuration property settings.allowed_values.0.label.0 doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get() (line 76 of /Users/mylaptopname/drupal/core/lib/Drupal/Core/Config/Schema/ArrayElement.php).
I cleared cache, still the same. I changed PHP version (PHP8.1.13 or PHP8.2.0), the same error.

In addition, in previous core version, I was able to type all options like "1|option1..." in a big box, very convenient. But this new version removed that feature.

When I try to add block field, I will have similar problem, but somehow the field is saved, so I will be able to come back to manage fields tab and choose from existing fields to edit.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Fixed

Version

1.0

Component
Field 

Last updated 3 days ago

Created by

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

Merge Requests

Comments & Activities

  • Issue created by @sdsc
  • 🇳🇿New Zealand quietone

    Formatting changes to make this easier to read.

  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    'type in anything' do you mean the normal format

    value|Label
    
  • 🇮🇹Italy bigtomfelix

    I confirm, same error, impossible to proceed. The problem is represented by the impossibility of adding fields to already existing and (previously) functioning projects.

  • Some updates:

    I redid it from scratch again: installed drupal 10.2.0, and then tested adding a list of text without adding other modules, works! So the previous problem indicates the compatibility issue of some modules with this new core version, but I don't know which one. so far, I added webform, commerce and display suite, still works!

    I need to create reference fields from a block in views, the current reference to views connects to the entire view rather than a block in that view, while reference to block seems has nothing to do with blocks in views. So previously I installed Block field module, but I am afraid it may give me trouble, because it is still the beta version. Any advice?

  • 🇳🇿New Zealand quietone

    @sdsc, thanks for reporting back on your progress, that is really helpful. Based on that I am changing this to a support request.

    For questions about the Block field module (which I am not familiar with), you can ask in issue queue for that module.

  • Found it!!!

    I went to update option value on an existing select list field, and I encountered the same error again! I then uninstalled "Field permission" module which I installed earlier today. Then I came back to edit the same select field, NO ERROR messages!!!

    So, for now, I am positive that the module Field Permission has some compatibility issue with the core version. Hope this information can help you solve the problem.

  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    That makes sense given 10.2 combines two forms, one of which field permissions would be form altering

  • 🇮🇹Italy bigtomfelix

    I confirm, the problem is caused by the field permission module, which still remains an indispensable module for some platforms.

  • Status changed to Needs review 12 months ago
  • 🇫🇮Finland lauriii Finland

    It looks like field permissions is triggering save of the field storage in an entity builder. Now that the field storage may be edited in the field config form, this could cause other undesired side-effects.

  • Merge request !20Do not call save on field storage in >10.2 → (Merged) created by lauriii
  • 🇫🇮Finland lauriii Finland

    Opened MR because it looks like this module is already using GitlabCI 🤩

  • 🇬🇧United Kingdom Janner

    I'm also encountering this after updating to Drupal 10.20 from 10.17.

    In my case I can't edit an existing field of type list select (text) or create a new field of this type.

    I have the Field Permissions module enabled, so am assuming that this is the root cause as described above for me too.

  • 🇺🇸United States jhedstrom Portland, OR

    Since this is critical, do we want to commit the current fix (all tests are passing) and deal with the fallout/ideal fix in a follow-up?

  • Status changed to RTBC 12 months ago
  • 🇫🇮Finland lauriii Finland

    I'm not sure why I was not seeing the setting being saved in my previous testing. I tested this both with existing fields and new fields and it seems that the value gets saved correctly with the MR. FWIW, it was working in the UI in all of my previous tests so maybe I was not looking at the right value with xdebug.

    So for what I'm concerned, the MR should be ready. We can work on moving the settings to the storage part of the form in a follow-up issue.

  • 🇮🇹Italy finex

    I've tested the patch and it looks fine. Thank you.

  • Status changed to Fixed 12 months ago
  • 🇺🇸United States jhedstrom Portland, OR

    Thanks all! I'll cut a new release shortly.

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

  • 🇺🇦Ukraine tarazingo Kyiv

    tarazingo changed the visibility of the branch 3409364-d10.2-add-select to hidden.

  • 🇮🇳India gokul.jayan

    Updating the Field permission module to 1.3 solves the issue.

Production build 0.71.5 2024