Problem/Motivation
I attempted to uninstall user_bundle locally to ensure it was a safe operation.
The new bundle was sharing the field `user_picture` with the standard user config. During the uninstall, all user_picture data was lost. Luckily this was just my local database that was trashed, could have been a lot worse.
Steps to reproduce
1. add a user bundle after module activation
2. give the new bundle the user_picture field
3. uninstall user_bundle
4. verify user_picture db table has been deleted
Proposed resolution
this issue https://www.drupal.org/project/user_bundle/issues/2980283 mentions
"It also may make sense, if possible, to move any fields on other user bundles to the standard "user" bundle so they're preserved. That way there's no data loss on uninstall - you're just back to the stock bundle-less experience where all fields sit on the one and only user type."
This seems like a better approach, manually deleting unwanted fields before or after uninstall would be trivial compared to losing data or restoring from backup. Maybe a note in the readme about the expected uninstall behavior would be helpful.
Issue fork user_bundle-3424125
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #5
amateescu commentedFixed in MR 6. On uninstall the module now migrates all user field data back onto the default user bundle instead of deleting the fields, so data shared with the standard user account (like user_picture) and data on custom bundles is preserved. Added a functional test covering both shared and custom-bundle fields. Thanks for the report!
Comment #7
amateescu commented