grails-audit-logging-plugin icon indicating copy to clipboard operation
grails-audit-logging-plugin copied to clipboard

getAuditDomainClass() method not found.

Open robertoschwald opened this issue 4 years ago • 2 comments

With fix for #189 we moved static methods from AuditLogListenerUtil to AuditLogListener instance. We forgot to fix the AuditLogEventController...

Thanks to David Brown for bringing that up (via Slack)

robertoschwald avatar Feb 11 '21 17:02 robertoschwald

Re-introducing a method in AuditLogListenerUtil seems not to be the right thing to do. The AuditLogEventController in general got the problem with audit domain class type definition, which is evaluated during runtime. For this, @Transactional does not work, as we do not know which datasource the AuditTrail domain class is bound to.

What would work is using <AuditTrailClass>.withTransaction{} wrapping, which makes the code ugly and also lead to wierd other problems (AuditTrail cannot be cast to AuditTrail)

I tend to remove the AuditLogEventController completely from the plugin and add a reference in the docs to the test AuditTrailsController (which also needs rework a bit)

robertoschwald avatar Feb 11 '21 19:02 robertoschwald

Working on Grails script to generate the Controller from template in users project.

robertoschwald avatar Mar 03 '21 21:03 robertoschwald