From a virgin D7 install:
- installing profile2
- disabling profile2
- uninstalling profile2 completely
- re-installing profile2
leads to the following error:
FieldException: Attempt to create an instance of field profile_fullname on bundle main that already has an instance of that field. in field_create_instance() (line 673 of /var/www/drupal-7/modules/field/field.crud.inc).
This is because hook_uninstall doesn't clear up any of the instances created by hook_install, so the re-install tries to create a duplicate instance on the main profile bundle. Obviously this field is a proof of concept at the moment but currently it's hard to comfortably test and re-test profile2 because this error means you can't really trust your own db without completely wiping it in between re-installs.
Please find attached a patch to clean up in hook_uninstall. I think the system still needs to purge somehow after removing the instances. Would appreciate any advice on that (see comment in patch.)
| Comment | File | Size | Author |
|---|---|---|---|
| profile2-hook_uninstall-tidy-up-instances.patch | 2.3 KB | jp.stacey |
Comments
Comment #1
matt2000 commentedDuplicate of #798784: Remove default fields and use EntityDB API to install/uninstall a default profile