The check function requires that a field mapping be set to show the fieldset on webform edit pages. However, it's not always necessary to create a mapping for SF to properly process the field names. (Many default fieldnames map correctly)

Also, the 'Salesforce Web-to-Lead Settings not set! ' warning message should probably be set as an error. (line 52 of sfweb2lead_webform.module)

Comments

vegantriathlete’s picture

Note: I have opened a separate issue for setting the warning message and will submit the patch for that.

vegantriathlete’s picture

Assigned: Unassigned » vegantriathlete
Status: Active » Needs review
StatusFileSize
new1.31 KB

Patch attached.

I have removed the requirement that there is at least one key value pair in the mapping fields. Now the fieldset appears on the content type to allow sending to salesforce whether or not mappings have been defined.

I have not changed any of the other logic that uses the variable that is retrieved (sfweb2lead_webform_mapping_settings) from the database as it did not appear to me that there would be any problem with the array being empty.

I have run an extremely basic test (webform that collects first_name and last_name) to ensure that the webform is still submitted properly to salesforce when no mappings are defined through the configuration page, i.e., all the webform fields map to the same names as the salesforce fields.

So, all appears to be okay to me with this patch. However, other people may want to beat on it more to see if I have overlooked any cases that would fail when then settings array is empty.

vegantriathlete’s picture

Version: 7.x-1.x-dev » 7.x-1.0-rc1

Ah, I forgot to change the version to the right one previously.

vegantriathlete’s picture

Assigned: vegantriathlete » Unassigned

Can't leave it assigned to myself. Other people need to RTBC.

Also, note that this patch seems to correct (or cause?) an issue with something about the newline at the end of file, which is also picked up with my other patch.

dago.aceves’s picture

Assigned: Unassigned » dago.aceves

I like the spirit of the patch and I'll give it some tests today. Thanks vegantriathelete.

  • dago.aceves committed e699559 on 7.x-2.x
    Issue #1555098 by vegantriathelete: Patch applied tested well.
    
    
chriscalip’s picture

Version: 7.x-1.0-rc1 » 7.x-2.x-dev
Issue summary: View changes
chriscalip’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.