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

Command icon 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

capysara created an issue. See original summary.

rajab natshah’s picture

Priority: Normal » Major
rajab natshah’s picture

Status: Active » Needs work
scottatdrake’s picture

@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.

rajab natshah’s picture

Yes, Scott, sure thing.

Planed to prompt an AI to do it for us

claude --permission-mode bypassPermissions """
Keep in a loop untile you finish the following for the admin_audit_trail Drupal module
Refactor the Admin Audit Trail module so the report at /admin/reports/audit-trail becomes a Drupal View.
Problem: The current table can’t be changed or customized.
Goal: Replace the hardcoded report with a View that users can modify, extend, or clone—similar to /admin/content.
"""

For sure to apply this in a contained sandbox like DDEV/Docker

I will be ready to test any MR, commit , then release

scottatdrake’s picture

Assigned: Unassigned » scottatdrake
Status: Needs work » Active

scottatdrake’s picture

Status: Active » Needs review

I have opened a MR and believe this is ready for review and testing.

rajab natshah’s picture

scottatdrake’s picture

Title: Make the table a view can be customized » Expose audit trail report as a View
Issue summary: View changes

yazanmajadba made their first commit to this issue’s fork.

rajab natshah’s picture

Assigned: rajab natshah » josebc
Issue summary: View changes
Issue tags: +admin_audit_trail-1.0.8
rajab natshah’s picture

Assigned: josebc » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

rajab natshah’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.