Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-15307

Concurrent edit by two users may overwrite Wiki draft

    Details

      Description

      In WikiPageLocalServiceImpl.java, the updatePage() method checks for concurrent edits by testing the WikiPage version. PageVersionException is thrown if the currently saved version number is greater than the version being edited.

      This logic will fail to detect concurrent edits if multiple drafts are saved since each draft retains the same version number.

      Possible solutions would be to check the modified date instead of the version number, or add an additional revision field to the WikiPage table. Since version is stored as a double, it is not possible to store sub-revisions within the version number (e.g. 1.2.5).

      To reproduce:
      1. Go to a Wiki page and click "Edit"
      2. Make some changes and click Save as Draft.
      3. Leave the editor open in this window and start a new session in a different browser. Go to the same Wiki page and click "Edit".
      4. The draft content saved in the first browser is loaded. Make some more edits and save as draft.
      5. Going back to the first window which is still open in the editor, make some more changes and save.
      6. The edits that were made in the second browser have now been lost.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              luyang.tan Luyang Tan (Inactive)
              Reporter:
              dtroxel Deb Troxel
              Participants of an Issue:
              Recent user:
              Patricia Perez
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                8 years, 38 weeks, 5 days ago

                  Packages

                  Version Package
                  6.1.1 CE GA2
                  6.1.20 EE GA2
                  6.2.0 CE M2