I noticed that there was an issue with the 7.x-1.4 version of this module when a user wants to refresh a page that is through a mandatory redirect through code.
It looks like the onUserExit.js doesn't capture this redirect change and keeps the old nid and ajax_key variables stored in the window.content_lock_onleave function from the first time loading the page. This doesn't play well and causes the old key to be stored the function and the new key isn't captured upon refresh. What I did was move the variables to be set outside of the function, which fixed the issue.
Also I went ahead and cleaned up the spacing on onUserExit.js and content_lock_init.js. I know that the onUserExit.js isn't a created library for this module but something picked up from an outside source, we might need to fork this since the contributor of that library seems to not have a way to update his codebase.
I uploaded a patch, but will need some review to see if this passes any other cases.
Comment | File | Size | Author |
---|---|---|---|
#1 | content_lock-fix-ajax-key-for-forced-redirects-2500605-1.patch | 10.37 KB | marioangulo |
Comments
Comment #1
marioangulo CreditAttribution: marioangulo commentedComment #2
marioangulo CreditAttribution: marioangulo commentedComment #3
marioangulo CreditAttribution: marioangulo as a volunteer and commentedComment #4
pandaski CreditAttribution: pandaski at XiNG Digital commented