Problem/Motivation

If some config has no schema and you use the options --only-error --detail on the drush command you get errors like:

 ---------------------------------------------------------------------------------------------------------------------------------- ---------------- ------------- ----------
  Key                                                                                                                                Status           Validatable   Data
 ---------------------------------------------------------------------------------------------------------------------------------- ---------------- ------------- ----------
  anchor_navigation.settings                                                                                                         No schema
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort                                                               No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort._core                                                         No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort._core.default_config_hash                                     No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.backend                                                       No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.backend_configuration                                         No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.backend_configuration.lease_time                              No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.dependencies                                                  No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.dependencies.enforced                                         No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.dependencies.enforced.module                                  No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.dependencies.enforced.module.0                                No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.id                                                            No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.label                                                         No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.langcode                                                      No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.locked                                                        No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.processing_time                                               No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.processor                                                     No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.status                                                        No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.threshold                                                     No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.threshold.limit                                               No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.threshold.state                                               No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.threshold.type                                                No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.uuid                                                          No schema        NOT           ✅❓

It's because it is incorrectly using the property paths from the previous config object it examined.

Steps to reproduce

Run drush config:inspect --only-error --detail when there is config with no schema and there is config with a schema earlier in the loop.

Proposed resolution

Initialise variable in the correct place.

Remaining tasks

User interface changes

Less incorrect info in output.

API changes

None

Data model changes

None

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

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review

daniel.bosen’s picture

Status: Needs review » Reviewed & tested by the community

I have lots of these errors in my projects. The patch fixes it and the implementation looks good to me.

herved’s picture

I stumbled on this issue in our CI, but cannot reproduce locally for some reason...

The patch does fix the issue for me as well, as long as I don't use --list-constraints
If I do, I get:

/vendor/bin/drush config:inspect --only-error --detail --list-constraints
>  🤖 Analyzing…

 [warning] Undefined array key "menu_position.settings" ConfigSchemaValidatability.php:164
TypeError: Drupal\config_inspector\ConfigSchemaValidatability::getConstraints(): Return value must be of type array, null returned in modules/contrib/config_inspector/src/ConfigSchemaValidatability.php on line 164 #0 modules/contrib/config_inspector/src/Commands/InspectorCommands.php(577): Drupal\config_inspector\ConfigSchemaValidatability->getConstraints()
#1 modules/contrib/config_inspector/src/Commands/InspectorCommands.php(257): Drupal\config_inspector\Commands\InspectorCommands::getPrintableConstraints()
#2 [internal function]: Drupal\config_inspector\Commands\InspectorCommands->inspect()

This might be another issue I'm not sure...

joelpittet’s picture

RE #5 Commited those menu_position.settings you posted thanks @herved!
RTBC++

gábor hojtsy made their first commit to this issue’s fork.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Looks very straightforward, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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