Affects Version/s: 6.0.5 GA, 6.0.12 EE, 6.1.0 CE RC1, 6.1.0 CE GA1
Environment:Tomcat 6.0.29 + MySQL. Firefox 3.6.13. 6.0.x Revision: 77302.
Tomcat 6.0.29 + MySQL. Firefox 3.6.13. 6.1.x Revision: 77302.
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).
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.