Jump to:
| Project: | Webform2Sugar: Capture webform result as new leads in SugarCRM |
| Version: | 7.x-5.0-alpha1 |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | andre.rocha |
| Status: | closed (fixed) |
Issue Summary
Hello.
This was my solution to export multiselect fields from the webform into sugarcrm, here is some description about the problem:
- Webform contains multiple checkboxes, which should be populated on a listbox into sugarcrm depending on being checked or not.
- webform2sugar module exports the selected checkboxes, sending their value instead of their key on form submission, i.e.
- A list box field is created in sugarcrm with the pairs: "somekey=>somevalue" and "somekey2 => somevalue2" ;
- The checkboxes in the webform have the corresponding options: "somekey|somevalue" and "somekey2|somevalue2" ;
- a checkbox with the pair "somekey|somevalue", when checked sends "somevalue" to the listbox, which is not recognized, simply because it was expecting "somekey" ;
- Result: A list box is populated in sugarcrm with and empty value (The list bullet appears, but the text is empty).
Solution:
- My solution is pretty straightforward but perhaps some feedback will make it more simple;
- I made a version of the function "webform2sugar_check_safe_key" which returns the $key instead of the value
- Replaced the "webform2sugar_return_safe_key" call with the new function call on the multiselect foreach cycle;
I'm sorry for not using git and applying a diff file, but with some help and feedback I would happily do it.
Comments
#1
I thought a fix for is was already rolled up into the latest dev release.
I am sure I tested select lists. Not sure about checkboxes.
Were you using the latest dev? Or is this still a problem in the latetest dev release?
#2
I'm using the latest dev version, updated December 3rd.
#3
Andre,
Because of some other blockers in the way that webform2sugar was working, the module actually was rewritten and is now available as version 5.
Can you see if this issue still exists with version 5? If so, hit me up on IRC #drupal and I can help walk you through how to make a patch. Or others there should be able to help.
rurri.
#4
It works great!
Thank you very much.
This may be a little of topic, but when clients submit the webform if it takes too long to process, they will try to refresh the page and the data is submitted twice into Sugar. Is there a workaround for the Webform module, or should the Sugar connector be called one step later?
Thanks in advance.
#5
Andre,
This has also been changed in version 5. Before webform2sugar would intercept the form posting. Now in version 5 webform2sugar hooks into where the webform entry is actually created. This means that there should only be a single submission to sugar unless the user is actually allowed to create multiple webforms.
So with the change to version numbers that should fix this issue.
If you are still having issues with version 5, there are some options you can use in webform to limit duplicate entries such as unique e-mail addresses, or by using cookies.
If you are able to duplicate an issue, in version 5 where only a single webform is created but multiple sugar leads are created, let me know, but I think this is fixed now.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.