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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Unexpected error when editing existing multiple choice option
Pages: [1]

Author Topic: Unexpected error when editing existing multiple choice option  (Read 1206 times)

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
Unexpected error when editing existing multiple choice option
August 27, 2008, 12:01:39 pm
I haven't seen a post about this in the forum, or a bug tracker example. Anyone else seen this?

I am running CiviCRM 2.0.6 on PHP 5.2.6, MySQL 5.0.45, Drupal 5. Have tried with multiple browsers. When trying to edit an existing multiple choice field option through the Custom Data admin interface, I get this error after clicking the "save" button:

Code: [Select]
Sorry. A non-recoverable error has occurred.

We experienced an unexpected error. Please file an issue with the backtrace

The backtrace is:

Code: [Select]
/var/www/vhosts/ipa.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 258
/var/www/vhosts/ipa.org/httpdocs/sites/all/modules/civicrm/CRM/Core/DAO.php, fatal, 627
/var/www/vhosts/ipa.org/httpdocs/sites/all/modules/civicrm/CRM/Custom/Page/Option.php, getFieldValue, 150
/var/www/vhosts/ipa.org/httpdocs/sites/all/modules/civicrm/CRM/Custom/Page/Option.php, browse, 305
/var/www/vhosts/ipa.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 758
/var/www/vhosts/ipa.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php, admin, 102
/var/www/vhosts/ipa.org/httpdocs/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 329
, civicrm_invoke,
/var/www/vhosts/ipa.org/httpdocs/includes/menu.inc, call_user_func_array, 418
/var/www/vhosts/ipa.org/httpdocs/index.php, menu_execute_active_handler, 15

I've tried this for individual custom fields and event participant custom fields, radio and checkboxes. Same result. Digging in the code a little bit it looks like whatever function in there is not successfully getting the field ID when trying to save. I don't know why, as the fid is in the GET query of the page that has the form with the Save button (http://www.domain.com/civicrm/admin/custom/group/field/option?reset=1&action=update&id=180&fid=21&gid=2).

PHP info is here: http://www.ipa.org/sites/all/modules/phpinfo.php

The CiviCRM demo does not exhibit this behavior, but it also looks like it's 2.1x now...

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Unexpected error when editing existing multiple choice option
August 27, 2008, 05:43:46 pm

I did a diff between the 2.0 and 2.1 versions of that file and there are not too many differences. I suspect the bug is data related. Can you help us debug it.

Can u print the value of $this->_fid on line 175, immediately after its assigned, u can do:

CRM_Core_Error::debug( 'fid', $this->_fid ); exit( );

If that has the value 21, can u print out the value of $this->_fid at line 149

thanx. Might be easier to debug this on IRC. Yes, we've upgrade demo to 2.1 in anticipation of the beta release (which should happen sometime soon)

lobo


A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
Re: Unexpected error when editing existing multiple choice option
August 30, 2008, 10:31:23 pm
I think you mean line 275? 275 looks like this:

Code: [Select]
        // get the field id
        $this->_fid = CRM_Utils_Request::retrieve('fid', 'Positive',
                                                  $this, false, 0);
watchdog('debug', 'fid line 275: ' . $this->_fid); // <-- my line
        $this->_gid = CRM_Utils_Request::retrieve('gid', 'Positive',
                                                  $this, false, 0);

When I get the above backtrace, the value of $this->_fid comes back as empty (or FALSE/NULL? CRM_Core_Error doesn't output anything either).

However, the more testing I do the less I can get consistent results. I'm also seeing an instance where the FID comes back correctly (value: 21), and I don't get the fatal error, but the field option is not actually updated with new values.

It seems like if I clear out the sessions table, the first attempt to change the multiple choice field will be the fatal error with backtrace posted above, but some subsequent attempts can result in the "silent" failure without the error.

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
Re: Unexpected error when editing existing multiple choice option
August 30, 2008, 11:50:05 pm
The stuff going into that retrieve() function looks like this:

name: fid
type: Positive

store: (object)

Code: [Select]
CRM_Custom_Page_Option Object
(
    [_gid:protected] =>
    [_fid:protected] =>
    [_name:protected] => CRM_Custom_Page_Option
    [_title:protected] => Custom Data Field
    [_mode:protected] =>
    [_embedded:protected] =>
    [_print:protected] =>
)

I don't understand all the things going on in retrieve(), but it seems like this is not enough info to retrieve the FID. At the same point, $_GET is set to:

Code: [Select]
Array
(
    [q] => civicrm/admin/custom/group/field/option
)

I'm guessing that the lack of an FID argument in $_GET is the source of the problem. Or should that function be getting it from the fieldId hidden field in the form?

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
Re: Unexpected error when editing existing multiple choice option
August 31, 2008, 01:28:46 am
Boy, this is tough. I disabled a ton of modules, tried again and successfully edited several multiple choice options. Then I started re-enabling segements of the module list to try to isolate something, but it just resulted in me being unable to replicate that brief window of success, despite disabling all the modules again. Have not been able to determine a pattern.

My testing method is to clear the drupal sessions table between iterations.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Unexpected error when editing existing multiple choice option

This forum was archived on 2017-11-26.