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
| Comment | File | Size | Author |
|---|
Issue fork field_permissions-3409364
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:
- 3409364-d10.2-add-select
changes, plain diff MR !20
Comments
Comment #2
quietone commentedFormatting changes to make this easier to read.
Comment #3
larowlan'type in anything' do you mean the normal format
Comment #4
bigtomfelix commentedI confirm, same error, impossible to proceed. The problem is represented by the impossibility of adding fields to already existing and (previously) functioning projects.
Comment #5
cilefen commentedComment #6
sdsc commentedSome 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?
Comment #7
quietone commented@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.
Comment #8
sdsc commentedFound 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.
Comment #9
larowlanThat makes sense given 10.2 combines two forms, one of which field permissions would be form altering
Comment #10
bigtomfelix commentedI confirm, the problem is caused by the field permission module, which still remains an indispensable module for some platforms.
Comment #11
lauriiiIt 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.
Comment #13
lauriiiOpened MR because it looks like this module is already using GitlabCI 🤩
Comment #14
Anonymous (not verified) commentedI'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.
Applying the above patch enabled me to edit and create fields again.
Comment #15
jhedstromSince 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?
Comment #16
lauriiiI'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.
Comment #17
finex commentedI've tested the patch and it looks fine. Thank you.
Comment #19
jhedstromThanks all! I'll cut a new release shortly.
Comment #22
gokul.jayan commentedUpdating the Field permission module to 1.3 solves the issue.