Adding revisions/versioning to user accounts is something which should be easier in D7, since we now have user fields, which support versioning if the bundle supports it. Outside the core user properties, this means adding revision support would cost us little.

Functionality-wise, this would mean a much better ability for sites, notably ones with a user moderation process, to keep track of user changes history, with the ability to rollback unapproved changes in an obvious fashion, by just reapplying a previous revision, like for nodes.

It could also slightly reduce the table with of users: user->init could now just be user->mail for the initial revision of the user account. This being a rarely user property, it wouldn't need to be loaded every time. Add an int (uvid column), drop a varchar (init column).

Much like nodes, most builtin (non-field) could be kept by-user-revision, with only basic (probably uid, uvid, name, changed, status) fields remaining in users and all other non-fielded properties going into users_revisions, or possibly migrating to fields : picture, for instance, does not seem a really obvious requirement for an always present user property, and would gain from being a field. Video avatars instead of plain old static ones, anyone ?

I'm willing to work on it starting immediately, to try getting this in before code freeze, but before committing (significant) work on it, I'd like to know how others feel about it.

Comments

swentel’s picture

I'm all in for this, although I'm not sure if we can get this in before the code freeze .. haven't analyzed it completely so I'm not sure. Maybe the best approach would be to start with small features (ie, changed field, uvid etc) and a contrib can easily do the job for D7 ?

fgm’s picture

Well, I've started with small things, as you suggest, based on D7U8:

  • added a {users_revisions} holding the base (non-fielded) properties, along with a log column and update author
  • added a uvid field to {users}
  • modified the user bundle declaration as versioned for field API
  • added an update_N to apply
  • modified user_menu() to add a revisions page much like the node revisions page
  • added 3 permissions: new "see user revisions", new "revert user revisions", new "delete user revisions", and added these rights to users with "administer users" permission

I still need to add the user update/deletion logic and I should have a patch to roll. Maybe this week, but alas I'm on holiday which means less time.

Additional ideas once the dust settles:

  • diff.module integration in Diff
  • a setting to choose whether user accounts are versioned or not
  • mass operations to remove existing revisions when switching from versioned to unversioned, and remove revisions on a list of accounts in user management
  • update views integration in Views to add these new tables and columns
attiks’s picture

A client is asking us the same, so
- Do you have a (partial) patch, so I can start from there?
- Any chance we can get this in Drupal 7.1, or is this D8?

fgm’s picture

Nothing currently. I started on it, then cut back on the functionality to have things on D6, and it ended as just a moderation process for user "fields".

A 7.x implementation would have to be Fields-based, but the need certainly remains.

attiks’s picture

I started building this for D7 as a contrib module, status so far is that revision is working on {users} fields and on attached fields, next up as a UI link node revisions have.

attiks’s picture

Damien Tournoud’s picture

Version: 7.x-dev » 8.x-dev

Feature requests should be assigned to D8.

attiks’s picture

damien, hence the new project ;p

attiks’s picture

FYI: first dev version added, feel free to provide feedback.

LarsKramer’s picture

There is a related issue about revision support for taxonomy: http://drupal.org/node/59429

Jelle_S’s picture

subscribing

tutumlum’s picture

subscribing

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.

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

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.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.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.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

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.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.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

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

geek-merlin’s picture

geek-merlin’s picture

I have the user_revision in use on a contrib site, but not too many people use it. Installation of the module is currently blocked by #3049787: Leverage EntityUpdate API (without this installing via web can lead to timeout and data loss). So if anyone want to help there, this is appreciated a lot.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

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

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

sukanya.ramakrishnan’s picture

Any update on this ticket ? Do we have a roadmap for making the user entity revisionable?

Thanks,
Sukanya

zenimagine’s picture

Version: 9.4.x-dev » 10.0.x-dev

Version: 10.0.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.