Custom audit log type breaking timeline
We have functionality that inserts a custom audit log type whenever a certain property is updated -
auditLogger.add(new AuditLogEntry(
"com/day/cq/wcm/core/page",
new Date(),
newEvent.getUserID(),
pageNodePath,
"PageRestricted",
entryProperties
));
This was added back in classic and has been working fine, but we just noticed that in touch it causes the timeline to display "An error has occurred." The log shows that this is because it can't handle that "PageRestricted" type -
2022-05-05T19:25:39.848Z *ERROR* 127.0.0.1 [1651778739703] GET /mnt/overlay/wcm/core/content/sites/jcr%3acontent/rails/timeline/items/timeline/items/events.provider.html HTTP/1.1 org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException
java.lang.IllegalArgumentException: Unknown modification type: PageRestricted
at com.day.cq.wcm.api.PageModification$ModificationType.fromName(PageModification.java:114)
at com.day.cq.wcm.core.impl.AuditLogTimelineEventProvider.getEvents(AuditLogTimelineEventProvider.java:122)
at com.adobe.granite.timeline.internal.TimelineAggregatorImpl.createTimeline(TimelineAggregatorImpl.java:82)
Is there any way to register that custom entry type so that timeline can consume it? Or does anyone have any suggestions on how we'd get around the error?
Thanks!