Closed (fixed)
Project:
Webform Pay
Version:
6.x-1.0-alpha2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Nov 2010 at 17:53 UTC
Updated:
11 Jan 2011 at 21:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
quicksketchYeah I've noticed this also. I'm not sure how to fix it currently but I haven't looked too deeply into the problem.
Comment #2
pixel8r commentedGetting the same error/issue.
this is my error message:
warning: array_merge() [function.array-merge]: Argument #2 is not an array in ../modules/webform_pay/webform_pay.module on line 212
Subscribing.
update: could you take a look at line 184? It seems off and might be what is causing the error. But of course I may be wrong. thanks!
Comment #3
muhleder commentedI think I have a fix for this, I'd like to test it a bit more before I upload a patch, but if anyone needs this now send me a message and I'll upload what I have so far.
Mark
Comment #4
muhleder commentedOk, here's the patch so far.
Changes in webform_pay.module
check for $element existing simply to stop errors.
added webform_pay_merge_multistep() function to merge in values from previous steps. Code pretty much a straight copy and paste from webform.module. Wasn't possible to use an existing webform function to do this.
Changes in webform_pay.inc
Override the submit function, so we only call the parent function when we are on the last screen of the multistep form. This was working for me with the payment method on the last screen, not sure if it would work if the payment method was on an intermediate screen.
Added
$this->pay_method_form($form, $form_state);
I think this was from another patch, and was needed to work with the current version of webform.
Added
$form_state['webform_pay']['values'][] = $values;
into the validate function, I think this was to make sure all the values from previous screens were included when calculating the totals.
Sorry for being a bit vague, been a few days since I worked on this and have been deep in another project since then. The key is overriding the submit function though.
Thanks,
Mark
Comment #5
muhleder commentedChanging status.
Comment #6
quicksketchExcellent work, thanks muhleder! I haven't had time to review the webform/webform_pay queues recently and it may be a while before I can take a look at this problem. Thanks for the patch.
Comment #7
quicksketchBased on muhleder's work I've created this patch which mostly fixes the problem. It allows Webform Pay components to be used in multi-page forms, but only on the last page of these forms. Information like products, name, phone, etc, can all be on previous pages. The reason for this restriction currently is because Pay module needs to fire its own submission handlers, but only on the last page of the form. It may be possible to separate the Pay form from the submission handlers, but we'll save that for a follow-up issue.
Comment #8
quicksketchI've filed a follow-up issue at #1009232: Pay component does not work on any page but the last one in multi-page forms.