Problem/Motivation
Since site settings are content entities, and content entities can be revisionable, it would be a good feature to add revisionability to the site settings entity.
This allows for a better audit trail to find out which user changed a particular setting at what time.
Proposed resolution
Add content entity revision support. Drupal 10 provides default UIs for content entity revisions.
Remaining tasks
* Update entity definition to define `revision_table`, `show_revision_ui` and `revision_metadata_keys` properties.
* Write site_settings.post_update.php logic to make the entity revisionable.
* Add revision UI - see https://www.drupal.org/node/3160443
User interface changes
* A new revisions tab will be available on the site settings entities.
API changes
none
Data model changes
Database will provide extra revision tables. Site setting entities being loaded will just be the latest revision, providing the same output as before.
Issue fork site_settings-3420330
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 #2
svendecabooterComment #3
scott_euser commentedSure, makes sense - definitely open to adding this if someone makes a merge request with test.
Thanks!
Comment #5
svendecabooterI created a MR to add this functionality + a basic test.
Seems tests are failing on something else... Is the 2.x branch supposed to pass all tests?
Comment #7
scott_euser commentedThanks very much, this is really solid! Gave it a few manual test runs as well after merging from 2.0.x to resolve conflicts and get the tests passing again (field UI changed recently, breaking the existing tests for that).