Problem/Motivation

Uninstalling the module does not accomplish clean up of user custom fields nor access data.
The fields are locked preventing administrators form manually deleting the fields from the user entity.
Attempts to reinstall the module are blocked as the fields already exist.

Steps to reproduce

Uninstall module
Attempt to reinstall, blocked.

Proposed resolution

Add uninstall hooks to delete the fields from the user entity and token records for all users.

This blocks the ability for me to use the module or conduct R&D.
Unless I have a database backup prior to first install.
Which is impractical for any "live" actively in use drupal instance.

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

emptyvoid created an issue. See original summary.

emptyvoid’s picture

For those looking for ways to actively salvage a corrupted database config refer to this thread.

https://drupal.stackexchange.com/questions/164612/how-do-i-remove-a-conf....

I'm attempting to create a patch which explicitly deletes the fields on uninstall.

function hook_uninstall() {
  \Drupal::configFactory()->getEditable('the_setting.you.want.to.delete')->delete();
}

And attempting to clean up an active install using drush.

drupal config:delete active config_to_delete
emptyvoid’s picture

On an active build where you installed the module and then uninstalled it. There by preventing you from reinstalling you can issue the following commands to free up the user entity.

drush config:delete field.field.user.user.field_access_tolken
drush config:delete field.field.user.user.field_refresh_token
drush config:delete field.storage.user.field_access_tolken
drush config:delete field.storage.user.field_refresh_tolken
drush cron
drush cr
emptyvoid’s picture

StatusFileSize
new891 bytes

patching adding uninstall for user settings

mahdiwadi’s picture

I've fixed the patch and successfully applied it. The issues have been resolved.

mahdiwadi’s picture

Status: Active » Fixed
mahdiwadi’s picture

Status: Fixed » Closed (fixed)
ahmadhalah’s picture

mahdiwadi’s picture

mahdiwadi’s picture

mahdiwadi’s picture