Install
Works with Drupal: ^10.6 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Download tar.gz
39.43 KB
MD5: 885303f04194d1fb93f1f00f8eea66d0
SHA-1: a494faa5628257322119c4a54a246e5ac5d8154b
SHA-256: 0e7e92f3b30873bf8c80788ec9ece7743553bf3e120af6385978e856794f4a41
Download zip
68.71 KB
MD5: 49ce8503bda4025ed98d74fb26746fbf
SHA-1: b8582c2b4868b6cdbf056375a2b3bb850fb606d0
SHA-256: 7cda3866fb695ca6abb03f68b5d1243dd94a3add5c523a4bcd758a2e471e2f47
Release notes
Upgrading from 8.x-1.x-dev
Take a configuration export, then run the database updates (drush updb). Review the following changes:
- Sensitive data is now redacted by default.
log_entity_operations_update_8101enables the "Redact sensitive information" setting with the default list of sensitive fields of the Drupal core entities, unless redacted fields were already configured. Review the "Sensitive data" section of the settings form and add your custom fields that store personal or secret data. - The "Entity Operation Logs" view is replaced.
log_entity_operations_entity_update_9003reinstalls the view shipped by the module, so any customization of it is overwritten. Apply your changes again after the update. The new view uses the core entity delete link, which respects the base path and the language prefix, is only shown to users who can delete logs and returns to the filtered list after deleting. - Entity access is enforced on the log entities. The new access control handler allows viewing logs with "Access Entity Logs" and deleting them with "Delete all Entity Logs". Logs can no longer be edited or created through the entity API with access checks, since they are an audit trail.
- The log cleanup uses UTC. The "date limit" of the submodule now compares against the stored UTC time, so logs are no longer kept or deleted early by the site timezone offset.
- The help pages show a short description instead of the raw README.
New features
- #3520545: Allow not saving sensitive information from diffs. Fields can be excluded or obfuscated per entity type and bundle.
- #3520805: New
hook_log_entity_operations_diff_alter()to alter the logged diff. It receives the diff after redaction. - The diff of an update compares the translation being saved. A new translation is logged with its values as added.
- Diffs with invalid UTF-8, for example from binary field values, are still logged.
- The collapsible diff formatter shows scalar values next to nested values, and falls back to plain text for values that are not valid JSON.
Bug fixes and compatibility
- #3574752: PHP 8.4 implicitly marking parameter as nullable is deprecated.
- #3497792: Remove VERSION from libraries.yml.
- Support for
EntityInterface::getOriginal()on Drupal 11.2 and later, keeping theoriginalproperty for Drupal 10. - Configuration changes apply within the same request.
- The log delete form loads the log from the route, so a missing log returns a 404 page.
- Logger messages are no longer translated.
- Plugins and the log entity type use PHP attributes, and the Twig template is compatible with Twig 3.29.
- The settings of the submodule have a configuration schema, and the view no longer depends on the Metatag display extender.
Tests and tooling
- #3091818: Kernel tests for create, update and delete logging with the diff, redaction, the diff alter hook, translations, access control and the diff formatter.
- #3635537: GitLab CI and coding standards.
Security considerations
Logged diffs can contain any value stored in the tracked entities. Read the "Security considerations" section of the README before enabling diff logging on a production site. In particular, without the "Log Entity Operations to custom Entities" submodule, anyone with "View site reports" can read the diffs in the database log.