Needs work
Project:
Payment for Webform
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 May 2013 at 11:08 UTC
Updated:
1 Jul 2014 at 08:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
xanoI have been digging through the code for a while, and it looks like Webform incorrectly sets the component value, but indeed only for multistep forms.
What happens is that Webform uses the value of the button that is part of the component as the component value.
Comment #2
quicksketchI don't plan on fixing this issue considering it seems specific to Payment for Webform. If there is a particular patch or suggestion that can be made to avoid this problem in Webform, I'm happy to take a look, but I probably won't go digging into this particular conflict without more information.
Comment #3
helmo commentedA related error:
Notice: Undefined offset: 0 in _webform_display_payment_webform() (regel 94 van /var/aegir/platforms/myplatform/sites/example.com/modules/contrib/payment_webform/payment_webform.webform.inc).@quicksketch: is it normal that the _webform_display_payment_webform() hook is called when the component is on another page?
I'm attaching two patch files to test for this condition and at least avoid a WSOD.
Comment #4
helmo commentedComment #5
quicksketchThe "display" hooks are only called when a component is having its value (rather than the form element) displayed. This happens when e-mails are sent, when viewing a submission, or when rendering a token for a previous field's value. Normally, none of these things happen until the final form is submitted. If it's happening between pages, there may be some kind of processing that is happening that Webform is not anticipating.
Comment #6
helmo commentedMoving this back to the Payment for webform queue, to get some review on the patches from #3
Comment #8
helmo commentedThanks bot... two patches for two modules...
Comment #9
helmo commented@Xano: Any thoughts on this?
Comment #10
xanoJust empty() should work too, and can you make sure this complies with the coding standards?
Also, can you explain the rationale behind this patch?
Comment #11
helmo commentedJust empty() would probably be enough.
Have you also looked at the second patch from #3 (for the payment_reference module)?
Maybe that the comment line from there could also be used in the first patch.
Comment #12
xanoThe comment is short, cryptic and refers back to this issue, so it needs some more love. What is a "bogus string value", why can it happen, and why is this the right solution?
Comment #13
xanoWe shouldn't do this. The form element documentation clearly states that the default value needs to be an integer. If there is a chance that a module sets something else, that module will have to add this check itself.
Comment #14
helmo commentedCould you link the 'form element documentation' documentation your referring to?
Of do you mean the #default_value in:
Comment #15
xanoyes. That documentation says the default value which needs to be a Payment PID, which in the class Payment is documented as an integer.
Comment #16
dgtlmoon commentedAlso able to reproduce this if you delete a payment and then return to the original webform, WSOD & same error
Comment #17
xanoBump. Does this problem still occur?
Comment #18
helmo commentedYes, I recently tried it without my patch https://www.drupal.org/files/1994392-paymentreference-test_pid.patch and quickly re-applied :(
Comment #19
xanoGood to know! We can't commit that, however, as this is a Webform issue. We'll either have to fix Webform or add a workaround to Payment for Webform.
Comment #20
xanoWhat about this patch from #3. Does that work?
Comment #21
helmo commentedNo, unfortunately the payment_webform patch does not help :(
I need the payment_reference patch to keep it working.
Comment #22
xanoCould someone answer this question from #12?