3

I have created an event with several payment options and it works properly with no issues. However, when adding a new fee (there are 5 at the moment that works), It doesn't get saved and the loader spinner just spins forever.

Underneath, when inspecting the network when the form is submitted, I get this

{status: "fatal",…} content : "Sorry but we are not able to provide this at the moment." crmMessages : [{,…}] 0 : {,…} options : null text : "We experienced an unexpected error. Please post a detailed description and the backtrace on the CiviCRM forums: http://forum.civicrm.org/" title : "Sorry an error occurred" type : "error" status : "fatal" title : "Configure Event - B1 Course" userContext : "/civicrm/event/manage?reset=1"

In the error logs, this detailed response is outputted:

There was a CiviCRM error at ISKCON London Ltd.
Date: 2017-06-11T12:52:30+01:00



***ERROR***
message:            
code:                

***LAST ERROR***


***LOGGED IN USER***
contact_id:         2
display_name:       Mr. Aashish Sharma
email_id:           
email:              
id:                 2

REMOTE_ADDR: 82.47.150.10
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36


***SERVER***
PATH:               /usr/local/bin:/usr/bin:/bin
REDIRECT_STATUS:    200
UNIQUE_ID:          WT0u-sMI3iEAABks7HYAAABJ
TZ:                 Europe/Sofia
OMP_THREAD_LIMIT:   1
HTTP_AUTHORIZATION: 
HTTPS:              on
SSL_TLS_SNI:        rldb.info
HTTP_HOST:          rldb.info
HTTP_CONNECTION:    keep-alive
CONTENT_LENGTH:     8826
HTTP_ORIGIN:        https://rldb.info
HTTP_USER_AGENT:    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
CONTENT_TYPE:       multipart/form-data; boundary=----WebKitFormBoundaryxVzJBFAoBtR543ba
HTTP_ACCEPT:        application/json, text/javascript, */*; q=0.01
HTTP_X_REQUESTED_WITH:XMLHttpRequest
HTTP_DNT:           1
HTTP_REFERER:       https://rldb.info/civicrm/event/manage/fee?reset=1&action=update&id=48
HTTP_ACCEPT_ENCODING:gzip, deflate, br
HTTP_ACCEPT_LANGUAGE:en-GB,en-US;q=0.8,en;q=0.6
HTTP_COOKIE:        SESSfdfbbafa8321456c2612c2aa8f3eb683=UM-Iryeyj-zQpNIzlWLda-cQEovuWWEBLfp_RW-LN-E; Drupal.tableDrag.showWeight=0; SSESSfdfbbafa8321456c2612c2aa8f3eb683=cOvpS0HYROxslVL4qewR4nCYYYg8VRpQZUmtSDA2Oik; has_js=1
SERVER_SIGNATURE:   
SERVER_SOFTWARE:    Apache
SERVER_NAME:        rldb.info
SERVER_ADDR:        195.8.222.33
SERVER_PORT:        443
REMOTE_ADDR:        82.47.150.10
DOCUMENT_ROOT:      /home/rldb/www/www
REQUEST_SCHEME:     https
CONTEXT_PREFIX:     
CONTEXT_DOCUMENT_ROOT:/home/rldb/www/www
SERVER_ADMIN:       admin@rldb.info
SCRIPT_FILENAME:    /home/rldb/www/www/index.php
REMOTE_PORT:        60253
REDIRECT_URL:       /civicrm/event/manage/fee
REDIRECT_QUERY_STRING:action=update&id=48&component=event&qfKey=8597fbacd761cbef1573e2c09b4cf85a_3956&snippet=json
GATEWAY_INTERFACE:  CGI/1.1
SERVER_PROTOCOL:    HTTP/1.1
REQUEST_METHOD:     POST
QUERY_STRING:       action=update&id=48&component=event&qfKey=8597fbacd761cbef1573e2c09b4cf85a_3956&snippet=json
REQUEST_URI:        /civicrm/event/manage/fee?action=update&id=48&component=event&qfKey=8597fbacd761cbef1573e2c09b4cf85a_3956&snippet=json
SCRIPT_NAME:        /index.php
PHP_SELF:           /index.php
REQUEST_TIME_FLOAT: 1497181950.1148
REQUEST_TIME:       1497181950
argv:               Array
(
    [0] => action=update&id=48&component=event&qfKey=8597fbacd761cbef1573e2c09b4cf85a_3956&snippet=json
)

argc:               1



***BACKTRACE***
#0 /home/rldb/www/www/sites/default/files/civicrm/ext/ca.bidon.reporterror/reporterror.php(251): reporterror_civicrm_generatereport("ISKCON London Ltd", (Array:2), NULL, (Array:0))
#1 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Core/Error.php(365): reporterror_civicrm_handler((Array:2))
#2 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Core/DAO.php(1070): CRM_Core_Error::fatal()
#3 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Price/BAO/PriceFieldValue.php(65): CRM_Core_DAO::getFieldValue("CRM_Price_BAO_PriceFieldValue", NULL, "price_field_id")
#4 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Price/BAO/PriceFieldValue.php(127): CRM_Price_BAO_PriceFieldValue::add((Array:3), (Array:1))
#5 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Price/BAO/PriceField.php(184): CRM_Price_BAO_PriceFieldValue::create((Array:3), (Array:1))
#6 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Event/Form/ManageEvent/Fee.php(670): CRM_Price_BAO_PriceField::create((Array:9))
#7 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Core/Form.php(447): CRM_Event_Form_ManageEvent_Fee->postProcess()
#8 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php(169): CRM_Core_Form->mainProcess()
#9 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php(136): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Event_Form_ManageEvent_Fee), "upload")
#10 /home/rldb/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Event_Form_ManageEvent_Fee), "upload")
#11 /home/rldb/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Event_Form_ManageEvent_Fee), "upload")
#12 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("upload")
#13 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#14 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(284): CRM_Utils_Wrapper->run("CRM_Event_Form_ManageEvent_Fee", "Event Fees", NULL)
#15 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:14))
#16 /home/rldb/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#17 /home/rldb/www/www/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:4))
#18 [internal function](): civicrm_invoke("event", "manage", "fee")
#19 /home/rldb/www/www/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:3))
#20 /home/rldb/www/www/index.php(21): menu_execute_active_handler()
#21 {main}


***POST***
qfKey:              8597fbacd761cbef1573e2c09b4cf85a_3956
entryURL:           https://rldb.info/civicrm/event/manage/fee?reset=1&action=update&id=48&component=event&qfKey=8597fbacd761cbef1573e2c09b4cf85a_3956
price_field_id:     168
price_field_value:  Array
(
    [1] => 537
    [2] => 538
    [3] => 539
    [4] => 540
    [5] => 541
    [6] => 
    [7] => 
    [8] => 
    [9] => 
    [10] => 
    [11] => 
)

discount_price_set: Array
(
    [1] => 
    [2] => 
    [3] => 
    [4] => 
    [5] => 
    [6] => 
)

cancelURL:          /civicrm/event/manage?reset=1
_qf_default:        Fee:upload
MAX_FILE_SIZE:      20971520
is_template:        0
is_monetary:        1
currency:           GBP
payment_processor:  1
pay_later_text:     I will send payment by cheque
pay_later_receipt:  
fee_label:          Event Fee(s)
financial_type_id:  9
price_set_id:       
label:              Array
(
    [1] => For all 6 Units of Bhakti Sastri
    [2] => If spouses/partners do course together. cost per participant
    [3] => Cost for One Unit
    [4] => For Temple Asrama
    [5] => Others - pay in 2 instalments
    [6] => test
    [7] => 
    [8] => 
    [9] => 
    [10] => 
)

value:              Array
(
    [1] => 275.00
    [2] => 250.00
    [3] => 50.00
    [4] => 0.00
    [5] => 137.50
    [6] => 50.00
    [7] => 
    [8] => 
    [9] => 
    [10] => 
)

default:            1
discount_name:      Array
(
    [1] => 
    [2] => 
    [3] => 
    [4] => 
    [5] => 
)

discount_start_date:Array
(
    [1] => 
    [2] => 
    [3] => 
    [4] => 
    [5] => 
)

discount_start_date_1_display_593d2e777d8ea:
discount_end_date:  Array
(
    [1] => 
    [2] => 
    [3] => 
    [4] => 
    [5] => 
)

discount_end_date_1_display_593d2e777ef79:
discount_start_date_2_display_593d2e77805c8:
discount_end_date_2_display_593d2e7781c84:
discount_start_date_3_display_593d2e778357c:
discount_end_date_3_display_593d2e7784b4b:
discount_start_date_4_display_593d2e7786147:
discount_end_date_4_display_593d2e7787771:
discount_start_date_5_display_593d2e7788e1e:
discount_end_date_5_display_593d2e778a52b:
_qf_Fee_upload:     Save

Any help would be much appreciated!

Thanks

Edit 1: Upgrading CiviCRM from 4.7.19 to 4.7.20 did not resolve the issue.

Edit 2: When creating a new event from scratch, I can add as many fee options as I want. But, if I save and then add a new fee, then these errors occur and I can't save.

Any help?

Edit 3: If I add a new fee (after it has been saved) and instead click on 'save and done', this is th emessage:

Fatal error: Uncaught CRM_Core_Exception: [0: Transaction integrity error: Expected to find active frame thrown in /home/rldb/www/www/sites/all/modules/civicrm/Civi/Core/Transaction/Manager.php on line 107

  • I am also experiencing this same issue. 4.7.19 Fatal error: Uncaught CRM_Core_Exception: [0: Transaction integrity error: Expected to find active frame thrown in /home/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/Civi/Core/Transaction/Manager.php on line 107 – themak Jun 12 '17 at 19:05
  • Hi Sovereign, look like a bug. Can you reproduce it on the dmaster.demo.civicrm.org site. – Kainuk - CiviCooP Jun 14 '17 at 20:22
  • @kanuk I am able to replicate it on your demo. I reported the bug at issues.civicrm.org/jira/browse/… The only error I get is Sorry but we are not able to provide this at the moment. Return to home page. – themak Jun 15 '17 at 20:50
  • @sovereign108 were you ever able to find a fix? – themak Jun 20 '17 at 21:41
  • @themak unfortunately not. I just tried to avoid the scenario. – Sovereign108 Jun 21 '17 at 22:33
1

TL;DR

Go to <site>/sites/all/modules/civicrm/CRM/Price/BAO/PriceField.php line 179

And to the following condition:

elseif (!empty($optionsIds)) {

Add another condition for verifying that the id exists and is not null, i.e. you may replace it with:

elseif (!empty($optionsIds) && isset($optionsIds['id'])) {

Explanation

This simple resolution was due to the investigative work of Favio Manriquez (JIRA) where he explained the following:

I was able to confirm this behavior. When debugging, if you print a stack trace at the Fatal Error location, you don't get a lot of information. By stepping through the code, I arrived at CRM_Price_BAO_PriceField::create(). I'll try to explain what is causing this error:

  • When you go to the configure screen for an Event, and then add a new fee (this doesn't happen for events that use price sets), the for loop goes through all fees, and updates or creates them as necessary. However, on the first if branch, the $optionsIds variable is set, and it is used again on the elseif branch at line 179 !!
  • It's only when you add a new Fee, that this elseif branch causes problems, because the last id in $optionsIds is NULL (for the new price that was created on first branch). This causes a fatal error via CRM_Core_Error::fatal() which forces a transaction rollback.

This code change was introduced on this commit for CRM-19517, but on previous versions the elseif branch is not present, so I'm not exactly sure why this code is needed.

I could add an easy PR to check if the id is null, but since this is related to CRM-19517, I would like to get more insight first.

As Favio explained, the null check is necessary because inside the elseif the value of $optionsIds['id'] is used:

 $optionsLoad = civicrm_api3('price_field_value', 'get', array('id' => $optionsIds['id']));
  1. If $optionsIds['id'] is null, invoking:

    $options = $optionsLoad['values'][$optionsIds['id']]

    Would be equivalent to invoke:

    $options = $optionsLoad['values'][null]

    Which would only trigger an "undefined index" notice (not stopping the execution).

  2. This would in turn provide null in $options, which are used later in: CRM_Price_BAO_PriceFieldValue::create($options, $optionsIds);
  3. Therefore the create is attempted with invalid options and that is why the Stacktrace starts with:

    CRM/Price/BAO/PriceFieldValue.php(65): CRM_Core_DAO::getFieldValue("CRM_Price_BAO_PriceFieldValue", NULL, "price_field_id")

Why the value is null there?

If we look back to line 99 of PriceField.php:

  $fieldOptions = civicrm_api3('price_field_value', 'get', array(
    'price_field_id' => $priceField->id,
    'sequential' => 1,
  ));

And think of the action we, as users, are trying to perform, i.e. editing/adding a new Fee field, the $fieldOptions['values'] will not contain this new field.

Thus the next and only foreach that assigns the options to $optionsIds prior to that elseif block:

foreach ($fieldOptions['values'] as $option) {
  $optionsIds['id'] = $option['id'];
  ...
}

Will not not have an iteration for this new field. At the point where civicrm_api3('price_field_value' is invoked to get the field associated to an id, since the new field's id does not exist, null will show up.

Therefore, this particular elseif block should only be run only if the field has an id already associated to it, the !empty($optionsIds) condition only prevented part of possible failures in this sense.

1

It is a bug (see https://issues.civicrm.org/jira/browse/CRM-20729) and it is fixed in 4.7.22. If an upgrade is not an option you can manually apply the patch https://issues.civicrm.org/jira/browse/CRM-20729 .

0

@sovereign108 The issue on Jira has been updated with a comment by @favrik. The workaround for now is to use price sets, as that is not impacted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.