Problem/Motivation
The report at /admin/reports/audit-trail uses a custom form with a hardcoded table structure. Users cannot modify columns, add filters, or customize the display without writing code.
Proposed resolution
Expose the admin_audit_trail database table to Views, following the pattern used by Drupal Core (eg /admin/content or /admin/reports/dblog)
The merge request change provides:
- A default View at /admin/reports/audit-trail with all current functionality
- Custom filter plugins for Type and Operation dropdowns
- User relationship for displaying usernames
- Full customization through the Views UI
The implementation is placed in `config/optional/` so the View auto-installs when Views is enabled, but the module remains functional without Views.
Remaining tasks
- ✅ File an issue
- ✅ Addition/Change/Update/Fix
- ➖ Testing to ensure no regression
- ➖ Automated unit testing coverage
- ➖ Automated functional testing coverage
- ➖ UX/UI designer responsibilities
- ✅ Readability
- ✅ Accessibility
- ✅ Performance
- ✅ Security
- ✅ Documentation
- ✅ Code review by maintainers
- ✅ Full testing and approval
- ✅ Credit contributors
- ✅ Review with the product owner
- ✅ Release notes snippet
- ✅ Release admin_audit_trail-1.0.8
API changes
New helper function: admin_audit_trail_get_event_types() returns registered event type labels for use in Views filters.
Data model changes
None. The existing admin_audit_trail table is now exposed to Views via hook_views_data().
Release notes snippet
- chore: #3272242 Expose audit trail report as a View -- By: capysara, scottatdrake, yazanmajadba
Issue fork admin_audit_trail-3272242
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
rajab natshahComment #3
rajab natshahComment #4
scottatdrake commented@rajab-natshah or other maintainer, are you looking for help implementing this? I've been hoping for this change and could possibly find some time to work on it, if you'd like.
Comment #5
rajab natshahYes, Scott, sure thing.
Planed to prompt an AI to do it for us
For sure to apply this in a contained sandbox like DDEV/Docker
I will be ready to test any MR, commit , then release
Comment #6
scottatdrake commentedComment #8
scottatdrake commentedI have opened a MR and believe this is ready for review and testing.
Comment #9
rajab natshahComment #10
scottatdrake commentedComment #13
rajab natshahComment #14
rajab natshahComment #16
rajab natshah✅ Released admin_audit_trail-1.0.8