Sugar is sweet! Simple webform2sugar now available for D5
About two weeks ago I shared a site recipe (Drupal + webform + SugarCRM) to get Drupal talking to SugarCRM. In my previous Sugar post I mentioned I would make a patch for sugarwebform module, since it was a bit out dated (Sugar changed it's code a bit causing sugarwebform to break).
Last week robbertn pushed up another Sugar related module - for Drupal 6, webform2sugar. His contribution is a re-write of the sugarwebform module. After reviewing his module I decided it was a better solution and to not patch the sugarwebform module.
Before backporting webform2sugar I did some extensive testing (see post) on what would be the best solution for my client. I believe this backport simplifies the module setup and gets Drupal talking to Sugar in a matter of minutes. In my opinion I feel webform2sugar is a bit superior to sugarwebform... Here are some reasons to use webform2sugar:
webform2sugar pushes data through the WebToLeadCapture sugarcrm form with the Campaign ID. Taking this route you no longer need the Sugar Username info.
No more hard coding Sugar fields or values in your module file
In webform2sugar you can map your webform fields to Sugar fields. You were not able to do this in sugarwebform.
Post processing, since webform2sugar (Drupal 5 version so far) uses it's own Drupal submit handlers to process the webform. This allows webform to still do it's post processing afterwards. I believe in the sugarwebform module there was a patch to make this happen.
For those who like code change details... Here are some code changes that were made in the backport (from Drupal 6 to Drupal 5):
- rid the need to hack the webform_submission.inc file (part of webform module)
- supports different editions of SugarCRM
- now has it's own submission handle, so all webform post processing can be done
- replaced fsockopen function to use drupal_http_request()
You can expect to see the backport posted on Drupal.org in the coming days.
I will push a patch (for Drupal 6 version of webform2sugar) to the webform2sugar issue queue thereafter.
Enjoy your Sugar! With Drupal of course! :)