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 CiviEvent (Moderator: Yashodha Chaku) »
  • Fatal error while editing a participation
Pages: [1]

Author Topic: Fatal error while editing a participation  (Read 2082 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Fatal error while editing a participation
July 30, 2008, 09:42:52 am
It happens to one and only one participant, the other works fine.

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

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

Return to home page.


Is there a way to force civi to spit out a bit more information or is there a log somewhere that could tell me more ?

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Fatal error while editing a participation
July 30, 2008, 10:11:54 am
Check CiviCRM.log in your configured Upload Files directory.
AND / OR you can Enable Backtrace from Admin CiviCRM >> Global Settings >> Debug Settings
Protect your investment in CiviCRM by  becoming a Member!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Fatal error while editing a participation
July 30, 2008, 10:19:27 am
So far in the log

Code: [Select]
Jul 30 18:46:01  [info] $Fatal Error Details = Array
(
    [message] => We experienced an unexpected error. Please file an issue with the backtrace
    [code] =>
)


Jul 30 18:46:01  [info] $backTrace = /var/www/civicrm/CRM/Core/Error.php, backtrace, 265

With backtrace:

Code: [Select]
/var/www/civicrm/CRM/Core/Error.php, backtrace, 258
/var/www/civicrm/CRM/Core/DAO.php, fatal, 627
/var/www/civicrm/CRM/Event/Form/Participant.php, getFieldValue, 325
/var/www/civicrm/CRM/Core/Form.php, setDefaultValues, 308
/var/www/civicrm/CRM/Core/QuickForm/Action/Display.php, buildForm, 98
/var/www/civicrm/packages/HTML/QuickForm/Controller.php, perform, 195
/var/www/civicrm/packages/HTML/QuickForm/Page.php, handle, 95
/var/www/civicrm/CRM/Core/Controller.php, handle, 223
/var/www/civicrm/CRM/Contact/Page/View/Participant.php, run, 98
/var/www/civicrm/CRM/Contact/Page/View/Participant.php, edit, 122
/var/www/civicrm/CRM/Core/Invoke.php, run, 431
/var/www/civicrm/CRM/Core/Invoke.php, contact, 98
/var/www/civicrm/drupal/civicrm.module, invoke, 329
, civicrm_invoke,
/var/www/drupal-5.7/includes/menu.inc, call_user_func_array, 418
/var/www/drupal-5.7/index.php, menu_execute_active_handler, 15

Ok, I'm digging around /var/www/civicrm/CRM/Event/Form/Participant.php, getFieldValue, 325

I suppose there is something around it. I'll let you know.

Thanks for the tip !

X+[/code]
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Fatal error while editing a participation
January 29, 2009, 09:07:55 am
Hi,

We ran into this bug on a CiviCRM 2.0 install. Here's our fix:

File: CRM/Event/Form/Participant.php around line 323

Code: [Select]
                if ($optionValue->option_group_id ){
                    $groupName       = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_OptionGroup', $optionValue->option_group_id, 'name' );
                    // [ML] 2009-01-22
                    $tmp_id = substr( $groupName, strchr($groupName, '.') );
                    // $fieldName       = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_PriceField', substr( $groupName, -1, 1 ), 'label') ;
                    $fieldName       = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_PriceField', $tmp_id, 'label') ;
                    $eventLevel[$id] = array( 'fieldName'   => $fieldName,
                                              'optionLabel' => $name );
                }

I.e. the substr($groupName, -1, 1) was taking only the last character of the group name (which is something like foo.1), but if it's ID is higher than 9, it takes only the last digit. So I used strchr to get the position of the dot so that we can extract the full id.

I haven't checked in the trunk yet to see if this bug still applies to recent versions of CiviCRM.

Mathieu (bgm)
Koumbit
« Last Edit: January 29, 2009, 12:26:36 pm by mlutfy »
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Fatal error while editing a participation
January 29, 2009, 12:50:31 pm
The code seems to have been refactored a bit in 2.2 (svn trunk), but is this the equivalent code? if yes, it should probably be fixed:

File: CRM/Event/Form/EventFees.php, around line 125

Code: [Select]
                $eventLevel = explode( CRM_Core_BAO_CustomOption::VALUE_SEPERATOR,
                                       substr( $defaults[$form->_pId]['fee_level'], 1, -1 ) );

is $defaults[$form->_pId]['fee_level'] assuming that the string is one digit only?

if yes:

Code: [Select]
                $tmp_id = substr( $defaults[$form->_pId]['fee_level'], strchr($defaults[$form->_pId]['fee_level'], '.') );
                $eventLevel = explode( CRM_Core_BAO_CustomOption::VALUE_SEPERATOR, $tmp_id );

sorry for not providing a proper patch.
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

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: Fatal error while editing a participation
January 29, 2009, 03:23:41 pm

thanx for the patch :)

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Fatal error while editing a participation

This forum was archived on 2017-11-26.