drush icon indicating copy to clipboard operation
drush copied to clipboard

Fix config:delete() to be safer and more powerful when working with config entities

Open alexpott opened this issue 4 months ago • 3 comments

Describe the bug A clear and concise description of what the bug is.

If you delete a node type via drush:config:delete Drush does this completely unaware of dependencies. It should use the config dependency system to do the delete. It should also delete config entities using the config entity system not the config system.

To Reproduce drush config:delete node.type.article

Expected behavior I expect Drush to warn me that there are dependencies and to work out if the config entity can be removed the same way Drupal core would - see \Drupal\Core\Config\Entity\ConfigDependencyDeleteFormTrait::addDependencyListsToForm

Actual behavior It deletes the config entity using \Drupal\Core\Config\Config::delete() which is wrong because it is entity... so none of the entity hooks fire and wrong because we don't manage dependencies.

Workaround Nope

System Configuration

Q A
Drush version? 12.x/11.x/10.x/8.x (please be specific, and try latest release)
Drupal version? 10.x/9.x/8.x/7.x
PHP version 8.x/7.x
OS? Mac/Linux/Windows

Additional information Add any other context about the problem here.

alexpott avatar Mar 04 '24 14:03 alexpott