0

In my custom module are in hook_unistall all its config entities deleted. One of the entities causes after uninstall the following error:

A non-existent config entity name returned by FieldStorageConfigInterface::getBundles()

Is there some possibility to test, if the config entity is needed? I look for something like:

foreach ($configs as $config) {
  if (\Drupal::configFactory()->getEditable($config)->canBeDeleted()) {
    \Drupal::configFactory()->getEditable($config)->delete();
  }
}

I tried also to add the following lines in all configs:

dependencies:
  enforced:
    module:
      - svg_verzeichnis

After that works the uninstall in one module correct, but in another module I receive still the same error. In the error message is no info, which config is missing...

  • 1
    You should let Drupal do this automatically, see drupal.stackexchange.com/questions/195173/… – 4k4 Jan 15 '18 at 14:23
  • I will try it... – Antonín Slejška Jan 15 '18 at 14:35
  • It looks like, it works. It is not quite optimal, because I can not automate the deinstallation of the configs, but it is probably the most stable solution. Thanks! – Antonín Slejška Jan 16 '18 at 8:51
  • I have used it also by another module. I have there ca. 100 configs. After uninstall is the website dead. The error message: 'A non-existent config entity name returned by FieldStorageConfigInterface::getBundles()' – Antonín Slejška Jan 17 '18 at 10:04
  • The problem is, that in the error message is no clue, which config is missing. – Antonín Slejška Jan 17 '18 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.