The cancel button on the new release content_lock-6.x-2.7 does not work.
Click on "Cancel" button refreshes node edit, it does not return to node view.

Comments

ohnobinki’s picture

Assigned: Unassigned » ohnobinki

Fixed on 6.x-2.x in 7443ee2, on 7.x-1.x fixed was merged in by f3bfe57. Fix will be in 6.x-2.8 and 7.x-1.3.

This bug was caused by overlooking one place where the security fix patch tried to check for the anti-CSRF token when it shouldn't be. The cancel button is implemented hackily, but through the form_api which is already itself protected against CSRF.

Thanks for the report!

izmeez’s picture

Yes, I wondered if it was related to the new security fixes but thought it best to open a specific issue.
Thanks.

middlenewman’s picture

Version: 6.x-2.7 » 7.x-1.2

Also doesn't work in 7.x-1.2

ohnobinki’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

damonbla’s picture

Version: 7.x-1.2 » 7.x-2.0
Issue summary: View changes
Status: Closed (fixed) » Active

I'm currently having this problem with version 7.x-2.0. Clicking the Cancel button just refreshes the node edit page, every time. Did a recent update remove the fix that worked for 7.x-1.2?

lambch’s picture

Same with me, damonbla.

marcus_clements’s picture

+1

gugalamaciek’s picture

+1

gbirch’s picture

+1 For what it's worth, I'm using a Bootstrap sub-theme, and it appears that some Bootstrap js is being attached to the click event on the cancel button, and not a function from content_lock js.

gugalamaciek’s picture

Strange thing.
Originally Cancel button is put in $form[actions][cancel]. In that case, #validate parameter looks to be ignored and not fired.
When I moved button directly to $form[cancel], #validate function is fired and in general it works.

izmeez’s picture

@ngwebs Can you provide a patch?

xrayfish’s picture

If you rename the button's label, for instance, from 'Cancel' to something else e.g. 'Cancel draft' the form is cancelled and you exit the draft.
For more information on this behaviour refer to - https://www.drupal.org/node/1342066

  • ohnobinki committed 7443ee2 on 8.x-1.x
    Fix Issue #1505022 by izmeez: cancel button does not work.
    
    This is a...

  • ohnobinki committed 7443ee2 on 7.x-3.x
    Fix Issue #1505022 by izmeez: cancel button does not work.
    
    This is a...
r_morgan’s picture

StatusFileSize
new1.96 KB

Here is a patch if for the 7.x-2.1 version of this module.

r_morgan’s picture

StatusFileSize
new491 bytes

My mistake, the last patch I submitted changes too many of the cancel button entries.

All that needs to happen to get the 7.x-2.1 to work is make a slight change to line 556 of content_lock.module file.

Better/reworked patch attached.

  • Joseph Zhao committed 2b11521 on 7.x-2.x
    Issue #1505022 by r_morgan, izmeez, ngwebs, ohnobinki, damonbla,...
pandaski’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Assigned: ohnobinki » Unassigned
Status: Active » Fixed

  • ohnobinki committed 7443ee2 on 7.x-3.x
    Fix Issue #1505022 by izmeez: cancel button does not work.
    
    This is a...
  • Joseph Zhao committed 2b11521 on 7.x-3.x
    Issue #1505022 by r_morgan, izmeez, ngwebs, ohnobinki, damonbla,...

  • Joseph Zhao committed fc20cd6 on 7.x-2.x
    Revert "Issue #1505022 by r_morgan, izmeez, ngwebs, ohnobinki, damonbla...

  • Joseph Zhao committed 407f855 on 7.x-2.x
    Issue #1505022 by r_morgan, izmeez, ngwebs, ohnobinki, damonbla,...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.