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

CommentFileSizeAuthor
#11 field-permissions-3409364-11.patch681 byteslauriii
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

sdsc created an issue. See original summary.

quietone’s picture

Issue summary: View changes

Formatting changes to make this easier to read.

larowlan’s picture

'type in anything' do you mean the normal format

value|Label
bigtomfelix’s picture

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

sdsc’s picture

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?

quietone’s picture

Category: Bug report » Support request
Priority: Major » Normal

@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.

sdsc’s picture

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.

larowlan’s picture

Project: Drupal core » Field Permissions
Version: 10.2.x-dev » 8.x-1.x-dev
Component: field system » Code
Category: Support request » Bug report

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

bigtomfelix’s picture

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

lauriii’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new681 bytes

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.

lauriii’s picture

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

Anonymous’s picture

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.

Applying the above patch enabled me to edit and create fields again.

jhedstrom’s picture

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?

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

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.

finex’s picture

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

  • jhedstrom committed 7b83fc87 on 8.x-1.x authored by lauriii
    Issue #3409364 by lauriii, sdsc, bigtomfelix, larowlan, quietone,...
jhedstrom’s picture

Status: Reviewed & tested by the community » Fixed

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

Status: Fixed » Closed (fixed)

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

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

gokul.jayan’s picture

Updating the Field permission module to 1.3 solves the issue.