Uninstalling my module threw this error:
[error] my_module: The My Field field type is used in the following field: my_module.my_field
But, since my module defines both an entity and a field, both of which will be uninstalled when I uninstall this module, it doesn't make sense. I'm trying to handle this by removing all of the fields programmatically in hook_module_preuninstall, which I have in the .module file because it wasn't working in the .install file.
The problem is, this hook runs after the checks for field dependencies. It would make more sense if it ran before, in my opinion, but, what can I use to get ahead of these checks? Anything? If not, what should I do so that my module realizes it needs to uninstall these things when the module is uninstalled?
Also, shouldn't this hook run earlier? If not, what is the point of it?
::uninstall()
method. Execute your code prior to theparent::uninstall($module_list, $uninstall_dependents)
call. I used this method to overcome a similar problem. See previousnext.com.au/blog/decorated-services-drupal-8