Even with the option to "Use javascript to detect leaving the node form", lock is not removed upon navigating away. Have to click Save or Cancel explicitly. Furthermore, it fails silently to remove the lock.
I traced it back to a 403 Forbidden error using the Inpect Element + Network Monitor features in Firefox. The 403 code is the response of the AJAX callback that is supposed to remove the lock, for example :
http://mysite/ajax/content_lock/<nodeid>/canceledit?k=567816212&token=Y7onBnXopNIj4vO-4ZhmnmxRi9m6sVnLMlDoUD8osFY&_=1459778612610
I further traced this back to some issue with permissions/user access. As far as I know, the permissions were set correctly, with Authenticated users having the Check Out/Lock Documents permission.
Initial fix: I had to revert line 81 of content_lock.module
78 $items['ajax/content_lock/%/canceledit'] = array(
79 'page callback' => 'content_lock_release_own_item',
80 'page arguments' => array(2, FALSE, FALSE),
81 'access callback' => 'user_access',
82 );to:
79 $items['ajax/content_lock/%/canceledit'] = array(
78 'page callback' => 'content_lock_release_own_item',
80 'page arguments' => array(2, FALSE, FALSE),
81 'access callback' => TRUE,
82 );, which was the code used in 7.x-2.0 (at line 80 for that version).
Better fix: please see patch submitted in #9.
A temporary workaround for me was to unset "Use javascript to detect leaving the node form", but I would much rather keep this enabled.
Comments
Comment #2
isolate commentedI have the same issue. Your suggestion fixes it for me. Added the patch
Comment #3
isolate commentedComment #4
mfbHow about keeping
user_accessas the callback, but also providing'access arguments' => array('check out documents')?Comment #5
leducvin commentedSounds reasonable, given my very limited understanding of Drupal programming. There should be some way to pass along the fact that the user has permission to check out/lock documents.
Comment #6
isolate commentedYou are right. Updated patch.
Comment #7
rohnjeynolds commentedThe patch in #6 patches the patch in #1, not the original file. This patch applies the suggestion in #4 to the actual module file. Hope the maintainer rolls this into the next stable version soon.
Comment #8
leducvin commentedComment #9
isolate commentedThanks for pointing that out!
The patch in #7 does not apply on latest stable release. Rolled patch to make our .make file work properly.
Comment #10
angel.hI think #9 now looks good.
Comment #11
Steel Rat commentedPlease disregard this comment. I uploaded my changes to the wrong folder. Brain fart.
Comment #12
leducvin commentedComment #13
amir simantov commented#9 works for me, as well. Thanks!
Comment #15
pandaski commentedThanks for your contribution. We are looking forward to seeing a new release very soon.