Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Save edit gains control of the standard submit button to allow overriding of the text, etc. But it also overrides the submit callback, which prevent other modules to add theirs.
This eg breaks webform module normal behavour (and several other modules more badly)
Comments
Comment #1
bellesmanieres CreditAttribution: bellesmanieres commentedPatch attached.
Comment #2
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedI have had a look at this patch and it looks like you have removed the code that overrides the submit callback but you have not added it the proper way either.
Here is how I did it for the Block Save and Edit module:
#744378: Prevents other modules to implement hook_form_submit ex: Block Class
hope it helps!
Switching to major IMHO.
Comment #3
El Alemaño CreditAttribution: El Alemaño commentedComment #4
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedComment #5
El Alemaño CreditAttribution: El Alemaño commentedComment #6
El Alemaño CreditAttribution: El Alemaño commentedComment #7
El Alemaño CreditAttribution: El Alemaño commentedComment #8
joegl CreditAttribution: joegl commentedDoes the patch fix the issue? I'm very interested in this module and think it would greatly reduce time spent on projects by cutting out on unnecessary clicks. However, I'm concerned about losing other module functionality mentioned in this issue.
Thanks!
Comment #9
joegl CreditAttribution: joegl commentedWell I reviewed the patch code and it appears to do exactly what Nicolas recommended. I have implemented it with no issues yet.
Comment #10
davidsickmiller CreditAttribution: davidsickmiller commentedPatch #7 effectively causes the "Text to use for default Save button" (save_edit_default_save_button_value) and "Default Save Button Weight" (save_edit_default_save_button_weight) options to be ignored. (They do get applied if "Hide default Save button" is selected, but in that case they don't make any difference.) The code newly moved inside the if block was not indented, so it looks like a mistake.
Here's a new version of #7 without that change (and without an unnecessary whitespace change).
I'm not sure how to test the underlying issue, so don't take this as a positive or negative confirmation of whether the root issue is fixed.
Comment #11
izmeez CreditAttribution: izmeez commentedI'm also not sure how to test this but the patch in comment #10 still applies cleanly to the latest 1.x-dev (2017-11-23) and looking at the patch it appears to be a reasonable fix.
Comment #12
mthomas CreditAttribution: mthomas commentedIn my case I found that there were extra handlers in `$form['actions']['submit']['#submit']` that I needed. The attached patch seemed to fix my issues.
Comment #13
izmeez CreditAttribution: izmeez commented@mthomas the patch in #12 is much simpler than the one in #10, is the new patch a replacement for the others offered? Thanks.
Comment #14
dbielke1986 CreditAttribution: dbielke1986 commentedschould work with version >8.x-1.4
Comment #15
caesius CreditAttribution: caesius at Forum One commentedThis is for the 7.x version of the module, which has not had any patches for this issue committed.
Comment #16
caesius CreditAttribution: caesius at Forum One commentedComment #17
yorkshire-pudding CreditAttribution: yorkshire-pudding at Backdrop CMS commentedThanks. I have included the patch at #12 in the Backdrop CMS version of this module.