Skip to content

Server error message (404) when clicking on tasks migrated from Confluence using recent versions of confluence-xml #108

@raphj

Description

@raphj

image

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 DocumentCreatedEvent and DocumentUpdatedEvent event types would be better suited than *ing events.

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions