Closed (fixed)
Project:
Commerce Square Connect
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Nov 2017 at 18:48 UTC
Updated:
1 Jan 2018 at 14:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
spokjeAttached patch checks if the selected payment method is Square Connect before "hijacking" the submit-button.
Comment #3
spokjeComment #4
czigor commentedWe should unbind the click event in detach instead.
Comment #6
spokjePatch #4 is against 8.x.1.x as it seems
Comment #7
spokjeReworked Patch #6 for version 7.x-1.x
Comment #8
spokje@czigor: Couldn't get the
$formSubmit.off('click.squareNonce');and$formSubmit.on('click.squareNonce');working on the$squareForm. It had to be$rootForm.Not sure if this is any different in the 8.x-1.x version
Comment #9
spokjeComment #10
spokjePatch #7 added the click event by mistake to the "Go back"-button as well.
Fixed in this patch
Comment #12
czigor commented@Spokje
In 8.x $submitForm is already the form element, that's why I removed $rootForm.
Also, "Go back" in 8.x is just a link, not a button.
Committed #4 to 8.x, so that we can focus on 7.x here.
Comment #13
czigor commentedJust a small performance fix: We don't need closes('form') on $form, it's already the form element.
Also removed some trailing whitespaces.
@Spokje Can you please test it?
Comment #14
czigor commentedRemoving one more closest().
Comment #15
spokjeWas just about to remove the comment on the remaining closest(), but you beat me to it.
Tested #14 and it works for me, so RTBC.
Comment #16
czigor commentedjQuery.on() was only added in 1.7, drupal 7 ships with 1.4.4.
Comment #17
czigor commentedAdding jquery_update as dependency.
Comment #19
czigor commentedCommitted, thanks!
Comment #20
mglamanWoah wait, we introduced a dependency in the 7.x branch for jquery_update? Why can't we use
bindversus on?Comment #22
mglamanTalked with czigor. To ease module maintenance and not add a dependency, let us just use
bindandunbind.Patch attached. I have not tested it yet. But it is the patch in #14 just with on/off replaced. Review/test appreciated!
Comment #23
czigor commentedPatch looks good and also works for me.
Comment #24
spokjeSame here in production environment: New patch works without need for jQuery update module.
Comment #26
mglamanThanks! I'm looking to tag a new release today or this week which will include this fix.