CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Fatal error: Call to a member function fields() on a non-object
Pages: [1]

Author Topic: Fatal error: Call to a member function fields() on a non-object  (Read 4139 times)

jday

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 6
  • CiviCRM version: 4.2
  • CMS version: 7.15
Fatal error: Call to a member function fields() on a non-object
September 06, 2011, 01:36:15 pm
we're using the drupal civicrm_webform module, just upgraded civicrm to 3.4.5

If someone submits the webform and already has a contact record, they get this error:
Fatal error: Call to a member function fields() on a non-object in..../public/sites/all/modules/civicrm/CRM/Core/DAO.php on line 367

if they don't have a contact record, it works fine. Seems like a problem with dedupe/merge maybe? Anyone run into this problem?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Fatal error: Call to a member function fields() on a non-object
September 19, 2011, 07:02:03 pm
This could be an API issue - I'd try replacing your API folder with the latest one from svn in case that helps (the 3.4.6 version).

Otherwise, I'd try turning on backtrace in your debug settings & capture the backtrace & post it here
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Stuart Parker

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 2
  • CiviCRM version: 4.5.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.63
  • PHP version: 5.2.14
Re: Fatal error: Call to a member function fields() on a non-object
September 21, 2011, 07:07:43 am
I am having the same problem (on 4.0.5). I'm not sure how to update the API, so maybe I'll just hold on until v4.0.6  ???

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Fatal error: Call to a member function fields() on a non-object
September 21, 2011, 03:03:56 pm
If you have time would be good if you can ensure backtrace is turned on in your debug settings (within Civi Administration menu - under global settings) & try to catch the backtrace error message & post it here
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Stuart Parker

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 2
  • CiviCRM version: 4.5.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.63
  • PHP version: 5.2.14
Re: Fatal error: Call to a member function fields() on a non-object
September 22, 2011, 04:26:40 am
Ok, I turned on debug and backtrace and repeated the form, but it only gave the same brief error. Not sure if I should be looking elsewhere for the backtrace.

There was also this notice in my error log:
Notice: Undefined variable: fieldIDs in CRM_Core_BAO_CustomValueTable::getValues() (line 603 of .../sites/all/modules/civicrm/CRM/Core/BAO/CustomValueTable.php)

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Fatal error: Call to a member function fields() on a non-object
September 22, 2011, 02:48:21 pm
Please collect as much information as you can, including what fields are on your form, and steps to reproduce starting with a clean webform.
I suspect this is related to custom data, so please check if it still happens without the custom fields, and note what types of custom fields you are using.
Then post an issue at: http://drupal.org/project/issues/webform_civicrm?categories=All
Thanks.
Try asking your question on the new CiviCRM help site.

Stuart Parker

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 2
  • CiviCRM version: 4.5.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.63
  • PHP version: 5.2.14
Re: Fatal error: Call to a member function fields() on a non-object
September 26, 2011, 04:53:31 am
Colemanw,

Thanks for the tip on Custom Data. I tried on the Webform CiviCRM tab turning off the Custom Data and it worked fine.

I then tried under the webform CiviCRM tab this little fix:
  • turn off each Custom Data set by changing the "Number of ... Fields" to 0
  • turn back on the same Custom Data set by changing the "Number of ... Fields" to whatever it was before. The checkboxes should be all the same as before
  • "Save Settings" at the bottom
The webform will hopefully now work ok again. :D
I don't know why this works, but maybe it's to do with the upgrade to Webform 3, which seems to have renamed the CiviCRM system field names.

I'd be interested if others could post whether this works for them.

Stuart
« Last Edit: September 26, 2011, 05:01:52 am by Stuart Parker »

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Fatal error: Call to a member function fields() on a non-object
September 26, 2011, 08:07:09 am
That's absurd! I can't believe that "worked" because technically, you didn't actually do anything. As the person who wrote that form, I have a hard time believing that is the reason your submissions started working, because turning a field off then on has a net effect of nothing, and when the form is submitted, it would see that nothings changed, and do nothing!
Try asking your question on the new CiviCRM help site.

Stuart Parker

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 2
  • CiviCRM version: 4.5.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.63
  • PHP version: 5.2.14
Re: Fatal error: Call to a member function fields() on a non-object
September 26, 2011, 08:13:33 am
Well, I bow to your greater knowledge, Colemanw. But I did notice that another field value that I had used in the automatic email from the webform had stopped working because the field key had been renamed ("Contact_1" had been inserted), presumably on the upgrade to Webform 3.

So I assume that the same has happened to the field keys for CiviCRM Webforms. Maybe the turning off and then turning back on of the custom fields reloads the correct field keys for Webform v3...?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Fatal error: Call to a member function fields() on a non-object
September 26, 2011, 09:23:39 am
Are you sure you're not referring to the upgrade from webform_civicrm 1 to webform_civicrm 2? I don't quite understand the reference to webform 3.
Try asking your question on the new CiviCRM help site.

Stuart Parker

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 2
  • CiviCRM version: 4.5.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.63
  • PHP version: 5.2.14
Re: Fatal error: Call to a member function fields() on a non-object
September 27, 2011, 12:33:23 am
Yes, maybe the reference to Webform v3 is a red-herring, although I did upgrade Webform from v2 to v3 recently, as well as upgrading to webform_civicrm 2.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Fatal error: Call to a member function fields() on a non-object
September 27, 2011, 07:14:15 am
Well since you're no longer seeing the problem, it does sound like something on your site was misconfigured, and re-saving the web-civi settings set it straight.
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Fatal error: Call to a member function fields() on a non-object

This forum was archived on 2017-11-26.