Context
Since the beginning of Liferay, two or more users can make changes to the same page at the same time. However, the last one to click the “Save” button keeps their changes but other users' changes are lost or all changes at the same time break the page and it won’t work anymore.
This situation does not occur very often but, when it does, contributors may lose the work they have done.
Aiming to have a solution to control concurrent edition on pages, here is the new feature to manage concurrent edition.
What we have done
With this new capability, now we automatically lock a page when a user is editing it and unlock it (automatically too) when the user has finished its edition and leaves the page edition.
In addition to that, if the user left the page in edition mode for a long time (configurable), a recurrent process (every 15 minutes, fixed time) will unlock the page automatically to make sure other users can edit it.
And finally, any Admin will be able to unlock manually any locked page from the UI.
How it works
Automatic Lock Process
Every time a user tries to access a page in edit mode, the process validates if the page is locked or not. Depends of the validation:
- Is locked: the user will be redirected to a generic error page:
In this page, if the process knows the previous page, the “Go to” button redirects to the previous page. Otherwise, there will be a “Go Back” navigation.
- Is not locked: the page will be locked with the first change at the page editor.
When the user changes to view mode or logs out or closes the tab, etc. the page will be unlocked automatically and other users could edit it.
Automatic Unlock Process
It may happen that, despite the controls and validations of the unlock process, a page remains locked when the user has already completed their changes or that a user leaves the page open in Edit mode for a long time without doing any changes, leaving the page locked for a long time.
In these cases, the automatic unlock process, every 15 minutes (system constant, it can’t be changed for now), will:
- Read from the database all the Pages that are locked.
- For each page, check the date-time of the last auto-save and calculate the difference (in minutes) between the current date-time and the last auto-save date-time of the page:
- If the difference is less or equal to the Time Without Auto-save parameter, the page will remain locked.
- If the difference is greater than the Time Without Auto-save parameter, the page will be unlocked automatically.
The configuration of the Automatic Unlock Process is at
Control Panel > Instance Settings > Content and Data > Pages > Locked Pages
In this page, users can turn On / Off the process and set the time ( in minutes ) that the page could be locked without any autosave.
Manual Unlock
And, what happens if I urgently need to edit a page that another user has locked?
For that purpose, we provide a new page (only available for Site Admin and Super Admin) with the list of locked pages and the possibility to unlock those that the user needs.
The Manual Unlock page is at:
Left menu | Configuration > Locked Pages
After selecting the page (or pages), the Admin can unlock it clicking on the three dot icon option or on the “Unlock” button.
Detailed flow
Demo & Additional Resources
Limitations
Next Steps
- Filter and Sorting criteria for the manual unlock page.
- Parameters on Site level.