Set up the sale force integration with no errors and attached it to a form.

On the form submission, I got the following error:

"Warning: explode() expects parameter 2 to be string, array given in webform_salesforce_submit_to_salesforce() (line 142 of /var/www/aps.gravityswitch.com/htdocs/sites/all/modules/webform_salesforce/webform_salesforce.module)."

It looks like we are getting the object name from the wrong place in the array on that line, after comparing it to the array created by "webform_salesforce_describe_objects()"

Comments

Anonymous’s picture

Creating a patch now . . .

Anonymous’s picture

nonsie’s picture

StatusFileSize
new2.09 KB

First of all thanks for catching that!

There's a small problem with the patch - value is the label of the object not the actual name. If you look at webform_salesforce_get_available_fields() it shows how the object names are retrieved. Here's a patch that uses 'object' rather than 'value' and also fixes an issue with required field options.

nonsie’s picture

Please check out the latest 7.x-1.x-dev, this should be now handled.

This comes from the fact that one can use hook_webform_salesforce_objects() to define custom objects and can pass more than one object as a set. For example:

function mymodule_webform_salesforce_objects(&$options) {
  // Add extra object types to webform config screen
  // If both Contact and Account are active then enable Account + Contact type
  if (isset($options['account']) && isset($options['contact'])) {
    $options['q'] = array('value' => t('Account + Contact'), 'object' => array('Account', 'Contact'));
  }
}

  • nonsie committed 7720aae on
    Issue #2198757: error when submitting form
    
  • nonsie committed 9be4c39 on
    Issue #2198757: error when submitting form
    

  • nonsie committed 7720aae on 7.x-2.x
    Issue #2198757: error when submitting form
    
  • nonsie committed 9be4c39 on 7.x-2.x
    Issue #2198757: error when submitting form
    
nonsie’s picture

Status: Active » Fixed
nonsie’s picture

Status: Fixed » Closed (fixed)