CMS Made Simple Core


[#10776] Expired content locks keep showing even after stealing lock

Created By: Tristan (tristan)
Date Submitted: Tue Dec 08 09:27:13 -0500 2015

Assigned To:
Version: 2.1
CMSMS Version: 2.1
Severity: Major
Resolution: Works For Me
State: Closed
Expired content locks keep showing even after stealing lock
Detailed Description:
On a fresh 2.1 install a content lock on a page expired 17 hours ago. When I
edit by clicking the "Steal this lock and edit this page" functionality, add
some content and submit. The content is successfully updated but the "!" icon
notifying that the page is being edited by another user doesn't disappear for
some reason. Since I can't remove the page either, this page will stay locked
forever basically.


Date: 2015-12-08 10:21
Posted By: Robert Campbell (calguy1000)

tested many, many times.
insufficient information to reproduce issue.
Date: 2015-12-08 10:24
Posted By: Tristan (tristan)

This was tested on Safari 9.0.1 on Mac OS 10.11.1 please let me know what
information you need so I can help fix this bug.
Date: 2015-12-09 02:53
Posted By: LB Back (lbback)

I can confirm that this happens on a clean install of version 2.1 with only
Admin user. If you leave the "Locking Expiration Time-out (minutes):" to default
value, then create a page, it locks the page. After 30 or 60 minutes (can't
remember the default value) a "Steal this lock" button appears and doesn't go
away after stealing. tested on Windows 10 Pro in Edge 25.10586.0, IE11, Firefox
42 and Chrome 47.0.2526.73 m
Date: 2015-12-09 03:17
Posted By: Tristan (tristan)

PHP: 5.5.30
Apache: 2
MySQL: 5.5.9
Date: 2015-12-09 05:50
Posted By: Tristan (tristan)

The content of the offending lock in the locks database table:

id: 10
type: content
oid: 1
uid: 1
created: 1449509966
modified: 1449509966
lifetime: 60
expires: 1449513566
Date: 2015-12-09 10:38
Posted By: Robert Campbell (calguy1000)

just tested again, with a brand new installation.  no issues here.
Date: 2015-12-09 12:10
Posted By: Tristan (tristan)

Just tested it again with a brand new installation as well. Still the exact same
problem I'm afraid. Maybe it would be better to disable locking by default on
new installations and upgrades from 1.12?
Date: 2015-12-09 12:23
Posted By: Robert Campbell (calguy1000)

Had another dev team member test on an installation of 2.1 on a remote server.  
No issues there either.
So my theory is that it has to do with crappy connections, or crappy servers.

Until such time as WE (the development team) can reliably reproduce the issue,
with proper access to debug the issue (ssh access) there is nothing we can do.
Date: 2015-12-09 12:41
Posted By: Tristan (tristan)

If a crappy connection is able to render pages locked forever it would only be
an extra reason to disable these locks by default right? I don't know exactly
what you mean by a crappy server. I tested on normal, run of the mill 13 in a
dozen servers, with normal loads.

If there is anything I can do to help you fix this bug let me know. I could
provide you with an CMS Made Simple admin account on one of these test installs
if that helps of course. Don't know if that's proper access enough for you guys?
Date: 2015-12-14 20:08
Posted By: Robert Campbell (calguy1000)

I am now using navigator.sendBeacon to do an ajax call when the page unloads (in
the beforeunload) event handler.
navigator.sendBeacon is nice in that it queues the ajax request for handling by
the browser even if it is closing.

However, it doesn't work on Safari or IE.  

Date: 2015-12-18 06:10
Posted By: Tomas Amsrud (tamsrud)

I had the same problem, and found a reproducable error.

If you edit a template so it gets locked, and then disables locking (set timout
to 0), then you cannot steal the lock. But if you enable locking by setting it
to 10 minutes, then you can steal the lock. Check there is no lock, and disable
locking, the problem is gone.

So there seems to be a bug where it is impossible to steal a lock if locking is
Date: 2015-12-20 14:13
Posted By: Rolf (rolf1)

CMSMS 2.1.1 is released

Updated: 2015-12-20 14:13
state: Open => Closed

Updated: 2015-12-08 10:21
resolution_id: => 11