I'm needing to use this module with Webform Pay. Can you point me in the right direction in order to extend your module to work with Webform Pay?

Comments

tedbow’s picture

Status: Active » Postponed (maintainer needs more info)

@greenSkin

I have never used the "Webform Pay" module.
Could you please give me more information about how they are incompatible? I don't have time to set up a test scenario. But it you provide more information maybe myself or someone else could help.

Thanks

markspall’s picture

I have the same problem. Have webform, webform conditional and webform pay modules installed. All standard webform components seem to comply with the conditional actions except the webform pay payment information field which is visible regardless of the conditional settings I put upon it.

tedbow’s picture

I would suggest using firebug and seeing if throws any javascript errors.

Also if anybody has used Webform Pay successfully please let us know here.

Thanks

theoracleprodigy’s picture

I am not seeing any javascript errors that are being thrown with firebug. In the tests that I have run it does not even seem to get the trigger on the form field. The option when building the form but its just not firing the javascript at all. Its as if the condition is never built.

Save the page then try this on the webform_conditional.js file:

Drupal.behaviors.webform_conditional.Matches = funciton(currentValues,triggerValues){
alert('current values: '+currentValues +' trigger value: '+triggerValues); <- this never fires. However on a different field with conditionals it fires just fine.

So somewhere its not building this into the form to look at the conditionals at all.

I did see that in the jQuery.extend(Drupal.settings the monitor_field_key is being set but I just don't see why its firing in the javascript.

theoracleprodigy’s picture

Okay here is what I found. Its missing an id on the webform payment css. The top of the javascript mentions in the webform conditionals script css_id":"webform-component-payment-information"] yet this id is no where in the html. So I have added the id to the html on a static page I saved and it works. The condition fires fine and the form disappears.

so it needs to have id="webform-component-payment-information" added to the div class="pay-cc-info"

Does someone know how to create the patch?

theoracleprodigy’s picture

Version: 6.x-1.x-dev » 6.x-1.0-rc2

I have just downloaded the latest version of webform pay, and pay. Still the same issue. Conditionals does not work, webform pay is still missing the id in the html.

Meant to set this to version: alpha3. Also I realize this is not a webform conditional issue but a webform pay issue so I have put it over in that queue which can be found here: http://drupal.org/node/1254524

theoracleprodigy’s picture

So not really knowing if I am following the standards for codding here is the fix I came up with the following changes. This is in the webform_pay.component.inc.

In the function _webform_render_components it is missing the #prefix and #suffix where you need to put in the id's. Usually that is written like so:

function _webform_render_component($component, $value = NULL) {
$form_item = array(
'#type' => 'textfield',
'#title' => $component['name'],
'#required' => $component['mandatory'],
'#weight' => $component['weight'],
'#description' => _webform_filter_descriptions($component['extra']['description']),
'#default_value' => $component['value'],
'#prefix' => '

',
'#suffix' => '

',
);

However we are looking for webform-component-payment-information so I have had to hard code those values (mostly because the type comes in with an underscore as "payment_information" from the $component['type']. So here is my fix:

Add the following lines after line 220 '#webform_component' => $component,
'#prefix' => '

',
'#suffix' => '

',