Modules can add data to a user's serialized data array by doing:

$user->data['foo'] = 'bar';

It would be ideal if a module in hook_uninstall() could perge the keys it stores in the array. However, this is not as simple as droping a column from the users table, since the data is stored in a single column as a serialized array, and to do so would require retrieving each row of the table, and saing those wher the key existed and was removed.

I am not sure if there is a performant method of doing this, or if it is even necessary based on the nature and quantity of data stored. But, I think it is worth a discussion.

Comments

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dpi’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

User data was re-written into a service for Drupal 8. All data is assigned to a module. When a module is uninstalled, the user data is also purged.