- Issue created by @Grevil
- Status changed to Postponed: needs info
8 months ago 7:27am 3 May 2024 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
I agree the schema looks correct. 🤔
However, the Config Inspector module does not contain the string
missing schema
anywhere. So it must come from\Drupal\Core\Config\Schema\SchemaCheckTrait::checkValue()
which contains:if ($element instanceof Undefined) { return [$error_key => 'missing schema']; }
- Can you please provide a config export of the config that triggers this error? Just paste the YAML here :) I bet that's where the problem is: the schema looks fine, but probably the config data itself is not.
- You can do what I'd do too: put a breakpoint on the quoted line above and re-trigger the error, then observe how you get to that point!
- 🇩🇪Germany Grevil
Sure thing!
Here is the output, which LGTM ("field_icon.settings.packages" throws the error: "'packages' is not a supported key."):
uuid: bef6d86a-4328-4e29-a0a9-6f83b1de96d7 langcode: en status: true dependencies: config: - field.field.node.article.body - field.field.node.article.comment - field.field.node.article.field_icon - field.field.node.article.field_image - field.field.node.article.field_tags - image.style.thumbnail - node.type.article module: - comment - image - micon - path - text _core: default_config_hash: ewbd6G2uX456-bgwseM2Q-KQG3RkASoyHmTh-XR3oLU id: node.article.default targetEntityType: node bundle: article mode: default content: body: type: text_textarea_with_summary weight: 2 region: content settings: rows: 9 summary_rows: 3 placeholder: '' show_summary: false third_party_settings: { } comment: type: comment_default weight: 20 region: content settings: { } third_party_settings: { } created: type: datetime_timestamp weight: 10 region: content settings: { } third_party_settings: { } field_icon: type: string_micon weight: 121 region: content settings: packages: fa: fa third_party_settings: { } field_image: type: image_image weight: 1 region: content settings: progress_indicator: throbber preview_image_style: thumbnail third_party_settings: { } field_tags: type: entity_reference_autocomplete_tags weight: 3 region: content settings: match_operator: CONTAINS match_limit: 10 size: 60 placeholder: '' third_party_settings: { } path: type: path weight: 30 region: content settings: { } third_party_settings: { } promote: type: boolean_checkbox weight: 15 region: content settings: display_label: true third_party_settings: { } status: type: boolean_checkbox weight: 120 region: content settings: display_label: true third_party_settings: { } sticky: type: boolean_checkbox weight: 16 region: content settings: display_label: true third_party_settings: { } title: type: string_textfield weight: 0 region: content settings: size: 60 placeholder: '' third_party_settings: { } uid: type: entity_reference_autocomplete weight: 5 region: content settings: match_operator: CONTAINS match_limit: 10 size: 60 placeholder: '' third_party_settings: { } hidden: { }
- 🇩🇪Germany Grevil
You can do what I'd do too: put a breakpoint on the quoted line above and re-trigger the error, then observe how you get to that point!
Can't seem to get into the correct loop iteration without "steping over" a hundred times.
And this workaround:
Doesn't seem to trigger xdebug for some reason...
- Status changed to Active
8 months ago 12:22pm 7 May 2024 - 🇩🇪Germany Grevil
Ok, no idea what I was doing there yesterday...
So I put a breakpoint at the exact location you pinpointed me to. But it looks fine to me!
The key is correct:
$key = "content.field_icon.settings.packages"
And the
$this->schema
variable also seems to hold the correct values:
and the schema definition looks good as well:
I really doubt, that the implementation of
Drupal\Core\Config\Schema\ArrayElement::get()
, which is inherited and used by the
$element = $this->schema->get($key);
call.
But I don't see anything else, that could lead to this? Am I missing something?