Problem/Motivation
Core itself defines a “Language select” field widget (\Drupal\Core\Field\Plugin\Field\FieldWidget\LanguageSelectWidget). However, the config schema definition for that widget (added in #2827784-34: LanguageSelectWidget should have options for which language types to show) is part of The Language module, in core/modules/language/config/schema/language.schema.yml.
Therefore, it is possible to use the “Language select” field widget without having its config schema definition available.
Steps to reproduce
Define a new content entity type where the langcode field is set to have a configurable form display with default type language_select. Any test without the language module enabled will fail with an error like this:
Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for core.entity_form_display.simplenews_subscriber.simplenews_subscriber.default with the following errors: core.entity_form_display.simplenews_subscriber.simplenews_subscriber.default:content.langcode.settings.include_locked missing schema
Proposed resolution
Simply move the config schema definition to Core, where it belongs.
Remaining tasks
- Review patch
- Probably write a test?
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
None needed, I’d guess?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3273888-4.patch | 1.28 KB | ravi.shankar |
| #2 | 3273888-2--language_select_widget_config_schema.yml | 1.28 KB | drunken monkey |
Comments
Comment #2
drunken monkeyComment #3
joachim commentedPatch has the wrong file ending, so isn't getting tested by CI.
Comment #4
ravi.shankar commentedAdded reroll.
Comment #5
joachim commentedThanks!
Comment #7
ravi.shankar commentedBack to RTBC as per comment #5.
Comment #9
adamps commentedI hit this with content a entity type where the langcode field is set to have a configurable form display. In my experience it's not difficult to hit - the natural simple code causes the error. In config/install I have the form display config that has no schema.
I was forced to change my code in #3298538: Show subscriptions field in Manage form display. This was also hit in #2921249: Failing test due to missing content.langcode.settings.include_locked schema and they changed their code too.
Comment #10
adamps commentedBack to RTBC.
Comment #12
adamps commentedComment #13
catchThis didn't apply but has been RTBC a while so I just did the removal hunk manually. Committed/pushed to 11.x, thanks!
Comment #15
catchComment #17
adamps commentedGreat thanks
Comment #18
wim leers