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.

Command icon 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

DanStorm created an issue. See original summary.

amateescu made their first commit to this issue’s fork.

  • amateescu committed eb40f187 on 8.x-1.x
    fix: #3424125 Uninstall deletes fields shared with standard user
    
    By:...
amateescu’s picture

Status: Active » Fixed

Fixed 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!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

amateescu’s picture

Version: 8.x-1.2 » 8.x-1.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.