Hi there,
thank you Victor for your effort and everything. I've started testing your great module. On your website I've found your post (see http://awebfactory.com.ar/node/270) and used it in order to test the module. I came to
"After saving the configuration, head over to Administer / Users and create a new user account (be sure to fill out the Personal Info in the new user's profile, the fields for which were created automatically in step 3 above, and make sure that the "create a lead in salesforce" checkbox is checked)."
And there it happend. I've filled out the new user form and submitted it. While submitting I've received the following error:
"Fatal error: Call to a member function query() on a non-object in /sites/all/modules/salesforce/includes/salesforce_api.inc on line 180"
What can we do?
Comments
Comment #1
bjacob commentedEDIT: just to let you know: the user is created in Drupal but not in Salesforce/leads...
Comment #2
eojthebraveSounds like your site isn't connecting to Salesforce. Or, for some reason the $saleforce client object isn't ever being initialized.
First thing to check would be to make sure your salesforce username/password are correct in Admin > Settings > Salesforce
Comment #3
victorkane commentedYes, this is correct. I have been able to reproduce the error by eliminating my Salesforce account info in admin/settings/salesforce.
The filer of this bug should have answered back if this were the case.
However, this should not produce a fatal error, it should inform of failure to communicate with salesforce. So am leaving open, but moving from critical to normal, since as soon as the salesforce username/password are correct in Admin > Settings > Salesforce, everything works normally.
Comment #4
victorkane commentedOK, when an enthusiastic user has enabled the salesforce module but not supplied a valid salesforce account user and password, and a lead should be inserted (as in the creation of a new Drupal user), there was no error checking on the creation of the $salesforce variable upon successful login.
In the function salesforce_lead() in includes/salesforce_api.inc I have added a check for the $salesforce variable not being false so that the query will not be made on a null object:
Have tested this and the fatal error is avoided upon unsuccessful salesforce authentication.
Have committed this error checking to DRUPAL-5 branch (dev snapshot will be available in the next few hours). Marking fixed, please test though.
Comment #5
bjacob commentedSorry for answering late. But you were right. I've misspelled my salesforce account data. It's a good idea to check if the salesforce connection is working. But wouldn't it be better to integrate this check on the module setting page (admin/settings/salesforce)? Then you can omit any other check. Anayway, thank you for your help. I've tested your new snapshot and now I'm getting the error message as you've described. Only one small thing is that the message appears twice. But no fatal error anymore. I will go on testing your great module.
Comment #6
victorkane commentedThanks, Björn!
Comment #7
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.