Content Locked After Forced Redirect and Going to New Page

Created on 4 June 2015, over 9 years ago
Updated 26 November 2024, about 2 months ago

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.

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States marioangulo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024