forked from xwiki-contrib/application-task
-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Description
This is because the task document doesn't exist. And that is because during migration, the document creating event is discarded in AbstractTaskEventListener.java by the first condition of the onEvent method:
@Override
public void onEvent(Event event, Object source, Object data)
{
if (this.observationContext.isIn(
otherEvent -> otherEvent instanceof BeginFoldEvent && !configuration.getNotSkippedFoldEvents()
.contains(otherEvent.getClass().getName())))
{
return;
}
XWikiContext context = (XWikiContext) data;
XWikiDocument document = (XWikiDocument) source;
processEvent(document, context, event);
}
I would guess that this is because we are indeed in a folded event while filtering, and I would also guess that it used to work because of the nested page migration, which we got rid of.
I believe one, or two of those two things are needed:
- lazily create task documents when they don't exist, so the task manipulation doesn't totally fail when clicking on checkbox (to make the app more defensive against such issues, or maybe provide a more user-friendly message when that happens. I'd be more a fan of an auto fixing situation though)
- update this condition so the event is handled. We need to consider that the migrator can produce several revisions. Maybe
DocumentCreatedEventandDocumentUpdatedEventevent types would be better suited than*ingevents.
Reactions are currently unavailable
