This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-a0167898-89f6-4387-a4d5-c61f9e891bee XWIKI-25471 Open

A page stays locked when its edit confirmation is displayed instead of the editor

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-167b1db5-0ce5-412b-be4f-c0de1cd7183c Michael Hamann created this issue on 22/Oct/26 11:58
 
Summary: A page stays locked when its edit confirmation is displayed instead of the editor
Issue Type: cid:jira-generated-image-avatar-a0167898-89f6-4387-a4d5-c61f9e891bee Bug
Affects Versions: 16.10.19
Assignee: Unassigned
Components: Edit
Created: 22/Oct/26 11:58
Priority: cid:jira-generated-image-static-major-6b5e92c7-094a-4733-afae-02898c6f0d56 Major
Reporter: Michael Hamann
Description:

Steps to reproduce

  1. As a user without script right, create a page with the content {{velocity}}$xcontext.user{{/velocity}}.
  2. As Admin, click on "Edit" on this page. The "Warning" page with the "Force editing" button is displayed because editing the page may result in the execution of currently disabled scripts.
  3. Click on "Cancel" (or leave the page in any other way).
  4. As another user, edit the page.

Expected result

The page can be edited.

Actual result

The edit confirmation says that the page is currently locked by Admin, although Admin never opened the editor. The lock stays until it expires or Admin cancels an edit of the page.

Cause

EditAction#render locks the document before edit.vm checks the edit confirmations. When a confirmation is needed, edit.vm displays it instead of the editor, but nothing releases the lock:

  • The "Cancel" button is a link to the view mode, not to the cancel action that removes the lock.
  • $editor isn't set on the confirmation page, so XWiki.editor is empty and lock.js doesn't consider the page as locked, so it doesn't send the cancel request when the page is left.

This applies to every edit confirmation that can be forced and isn't about a lock held by another user (required rights, pages installed by an extension). In the docker tests, it made one failing test in VersionIT leave XWiki.XWikiPreferences locked and fail several other tests of the suite (see XWIKI-24822).