Hello,

I'm testing your module in a new site that I'm working on and am using a custom field that has been added through Insightly. I have the field ID entered into the module settings as "CONTACT_FIELD_1", which appears to be working fine during tests. The other fields that I'm using are FIRST_NAME, LAST_NAME, PHONE and EMAIL.

The problem that I'm having is the first time I attempt to submit the form I get the following Fatal ERROR message:

Fatal error: Cannot use object of type stdClass as array in /srv/bindings/8123fda0223a4f269fe9431dc8ec4030/code/sites/all/modules/webform_insightly/webform_insightly.inc on line 202

After I get the error, if I go back to the form page and resubmit then is works fine, and form submits successfully. The form submission also sends the form information to Insightly correctly with all field information, including my custom field information.

Why would the fatal error appear on first submission but not when the form is resubmitted after error?

Any info would be truly appreciated, since I'm very much in need of the functionality.

Thanks!

Comments

jalapi created an issue. See original summary.

yanyong’s picture

Just fire up the xdebug, it turn out the $result is actually a std object, so when we try to access it as array, the fatal php error occurred.

jalapi’s picture

Excellent! Your #2 patch worked perfectly. No more errors and the module is working great. I might suggest moving this patch forward into the next release.

This module is now the only stable integration that helps with integration of Insightly to Webform.

I might suggest for future release to provide all of the relevant ID's available for the Insightly field mapping and a hint or link to the API developer section https://api.insight.ly/v2.2/Help#!/Contacts/GetContacts . This comes in handy for finding the correct ID's for mapping fields, which can be difficult to find through Insightly.

Also, if there were an option to post to "Leads" as well as Contacts it would make it even better. :)

Thanks again.

- D. Crigler

jalapi’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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

binnythomas’s picture

Status: Closed (fixed) » Reviewed & tested by the community

I checked this out and the patch fixes the error. Proceeding to apply in dev branch

  • zyxware committed 132d204 on 7.x-1.x authored by yanyong
    Issue #2713181 by yanyong: Fatel Error Message for webform_insightly.inc...
zyxware’s picture

Status: Reviewed & tested by the community » Fixed

  • zyxware committed 132d204 on 7.x-2.x authored by yanyong
    Issue #2713181 by yanyong: Fatel Error Message for webform_insightly.inc...
deepakrmklm’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

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