Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25471

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 16.10.19
    • Edit
    • None
    • Unknown

    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).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: