Ading a new field to a content type by adding field.storage.node.myfield.yml & field.field.node.article.myfield.yml configs to config/install directory of my custom_module module.

This field is of type customfieldtype which is defined in the custom_module module itself.

This adds a new field myfield of type customfieldtype to the article content type.

Now if I try to uninstall this module via the UI, it doesn't allow the module to uninstall because of this dependency: The MyField field type is used in the following field: node.myfield

Question: Do we require to move the plugin implementation of customfieldtype to be in a separate module? Can we not achieve the uninstall on this custom module?

  • See drupal.stackexchange.com/questions/297487/…
    – 4uk4
    Mar 25, 2021 at 16:32
  • Thanks @4k4 for the reply. This is suggesting to add enforced module dependency on the field storage configuration. which is fine when I want to remove the field when module gets uninstalled. But the problem is the custom module itself is the provider of that field type and hence the uninstall validation doesn't allow the provider module to be uninstalled without removing the storage first.
    – JayKandari
    Mar 26, 2021 at 9:05
  • have you deleted the content related tot the custom module, then deleted the custom module?
    – Joehoe
    Mar 27, 2021 at 11:53
  • yup @Joehoe, removed the content before uninstall.
    – JayKandari
    Apr 1, 2021 at 13:40


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.