message for SchemaIncompleteException uses config_name:property which is unclear

Created on 26 February 2024, 10 months ago

Problem/Motivation

Errors in config schema which are checked by ConfigSchemaChecker throw a SchemaIncompleteException with messages like this:

> Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for action_link.action_link.test_changed with the following errors: action_link.action_link.test_changed:plugin_config missing schema

It's not clear what the 'foo.bar:biz.bax' format means.

Changing this to explicitly say config foo.bar property biz.bax would be clearer.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component
Configurationย  โ†’

Last updated about 4 hours ago

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

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

Merge Requests

Comments & Activities

  • Issue created by @joachim
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim
  • Pipeline finished with Failed
    10 months ago
    Total: 659s
    #104146
  • Status changed to Needs work 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Appears to have test failures.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

    Tagging as novice, because test failures should be just a case of updating the expected exception messages.

  • First commit to issue fork.
  • Pipeline finished with Failed
    8 months ago
    Total: 862s
    #147020
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland markusVJH

    I added a commit to try to update the tests to match the new format of the expectation message, apologies if I jumped the shark on that one. I am not yet sure should be done about the test failures @joachim.

  • First commit to issue fork.
  • Pipeline finished with Failed
    about 2 months ago
    Total: 558s
    #329707
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

    Hi @Joachim,

    Iโ€™ve reviewed the test failures caused by recent changes to ConfigSchemaChecker. It seems that while some failures relate to changes in the exception messages, others are due to how we handle cases where $key isnโ€™t in the expected foo.bar:bar.biz format. Specifically, weโ€™re seeing integer keys instead of the expected string format, which leads to $error_property being null. This causes the error:
    TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given

    For example, in scenarios like:

    array:4 [
      0 => "[dependencies.theme.0] Theme 'bluemarine' is not installed."
      1 => "[theme] Theme 'bluemarine' is not installed."
      2 => "[region] This value should not be blank."
      3 => "[region] This is not a valid region of the <em class=\"placeholder\">bluemarine</em> theme."
    ]
    

    Here, $key does not split as expected, leading to null in $error_property. Currently, we havenโ€™t implemented any handling for integer keys, which leads to the failures to these test method i have checked like : testInvalidConfiguration(), testConfigSchemaChecker(), and testBlockMigration() .

    Could you please advise on how to handle integer keys? One approach could be to check if the $key is an integer and set $error_property as blank in such cases, or we could use the string representation of the key, like [dependencies.theme.0], as the property. Please let me know if you have a preferred direction for managing this scenario, or if I'm overlooking any potential cases. I am moving this for review to get your input on it. Thank you!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Issue summary appears incomplete, Did not reiew

Production build 0.71.5 2024