Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Blocker
-
Resolution: Cannot Reproduce
-
Affects Version/s: 4.7.19
-
Fix Version/s: 4.7.19
-
Component/s: CiviContribute
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Needs Funding
-
Verified?:No
Description
When filling in the additional payment form get a MySQL crash. I've run all DB upgrades for this version. Changes were made to this form lately.
This occur by filling in the form at /civicrm/payment/add?reset=1&action=add&cid=6&id=190&component=event&mode=live (where id is a participant id with a contribution).
For some reason, the value 2017 is getting entered into the trxn_date field, for which it is not a valid entry. However, entering it directly into the DB works. The full query is:
INSERT INTO civicrm_financial_trxn (from_financial_account_id , to_financial_account_id , trxn_date , total_amount , fee_amount , net_amount , currency , is_payment , trxn_id , status_id , payment_processor_id , payment_instrument_id , card_type_id , pan_truncatio
n ) VALUES ( 7 , 6 , 2017 , 5.00 , 1.5 , 3.5 , 'GBP' , 1 , 'live_10_59034fe952e08' , 1 , 5 , 4 , 1 , '1111' );
Plainly, 2017 isn't a date.
I haven't been able to trace the point at which it starts being an invalid date.
Database Error Code: Incorrect datetime value: '2017' for column 'trxn_date' at row 1, 1292
Additional Details:
Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -1 [message] => DB Error: unknown error [mode] => 16 [debug_info] => INSERT INTO civicrm_financial_trxn (from_financial_account_id , to_financial_account_id , trxn_date , total_amount , fee_amount , net_amount , currency , is_payment , trxn_id , status_id , payment_processor_id , payment_instrument_id , card_type_id , pan_truncation ) VALUES ( 7 , 6 , 2017 , 5.00 , 1.5 , 3.5 , 'GBP' , 1 , 'live_10_5903cbfc33d20' , 1 , 5 , 4 , 1 , '1111' ) [nativecode=1292 ** Incorrect datetime value: '2017' for column 'trxn_date' at row 1] [type] => DB_Error [user_info] => INSERT INTO civicrm_financial_trxn (from_financial_account_id , to_financial_account_id , trxn_date , total_amount , fee_amount , net_amount , currency , is_payment , trxn_id , status_id , payment_processor_id , payment_instrument_id , card_type_id , pan_truncation ) VALUES ( 7 , 6 , 2017 , 5.00 , 1.5 , 3.5 , 'GBP' , 1 , 'live_10_5903cbfc33d20' , 1 , 5 , 4 , 1 , '1111' ) [nativecode=1292 ** Incorrect datetime value: '2017' for column 'trxn_date' at row 1] [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_financial_trxn (from_financial_account_id , to_financial_account_id , trxn_date , total_amount , fee_amount , net_amount , currency , is_payment , trxn_id , status_id , payment_processor_id , payment_instrument_id , card_type_id , pan_truncation ) VALUES ( 7 , 6 , 2017 , 5.00 , 1.5 , 3.5 , 'GBP' , 1 , 'live_10_5903cbfc33d20' , 1 , 5 , 4 , 1 , '1111' ) [nativecode=1292 ** Incorrect datetime value: '2017' for column 'trxn_date' at row 1]"] )
#0 /srv/www/4719/sites/all/modules/civicrm/CRM/Core/Error.php(187): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /srv/www/4719/sites/all/modules/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error))
#3 /srv/www/4719/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->_construct("DB Error: unknown error", -1, 16, (Array:2), "INSERT INTO civicrm_financial_trxn (from_financial_account_id , to_financial...")
#4 /srv/www/4719/sites/all/modules/civicrm/packages/PEAR.php(575): DB_Error->_construct(-1, 16, (Array:2), "INSERT INTO civicrm_financial_trxn (from_financial_account_id , to_financial...")
#5 [internal function](): PEAR->raiseError(Object(DB_mysqli), NULL, -1, NULL, NULL, "INSERT INTO civicrm_financial_trxn (from_financial_account_id , to_financial...", "DB_Error", TRUE)
#6 /srv/www/4719/sites/all/modules/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8))
#7 /srv/www/4719/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
#8 /srv/www/4719/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "INSERT INTO civicrm_financial_trxn (from_financial_account_id , to_financial_...", "DB_Error", TRUE)
#9 /srv/www/4719/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, NULL, "1292 ** Incorrect datetime value: '2017' for column 'trxn_date' at row 1")
#10 /srv/www/4719/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#11 /srv/www/4719/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("INSERT INTO civicrm_financial_trxn (from_financial_account_id , to_financial_...")
#12 /srv/www/4719/sites/all/modules/civicrm/packages/DB/DataObject.php(2438): DB_common->query("INSERT INTO civicrm_financial_trxn (from_financial_account_id , to_financial_...")
#13 /srv/www/4719/sites/all/modules/civicrm/packages/DB/DataObject.php(1060): DB_DataObject->query("INSERT INTO civicrm_financial_trxn (from_financial_account_id , to_financial...")
#14 /srv/www/4719/sites/all/modules/civicrm/CRM/Core/DAO.php(490): DB_DataObject->insert()
#15 /srv/www/4719/sites/all/modules/civicrm/CRM/Core/BAO/FinancialTrxn.php(66): CRM_Core_DAO->save()
#16 /srv/www/4719/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(3393): CRM_Core_BAO_FinancialTrxn::create((Array:64))
#17 /srv/www/4719/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(3803): CRM_Contribute_BAO_Contribution::recordFinancialAccounts((Array:24), (Array:57))
#18 /srv/www/4719/sites/all/modules/civicrm/CRM/Contribute/Form/AdditionalPayment.php(373): CRM_Contribute_BAO_Contribution::recordAdditionalPayment("115", (Array:57), "owed", "190")
#19 /srv/www/4719/sites/all/modules/civicrm/CRM/Contribute/Form/AdditionalPayment.php(323): CRM_Contribute_Form_AdditionalPayment->submit((Array:19))
#20 /srv/www/4719/sites/all/modules/civicrm/CRM/Core/Form.php(447): CRM_Contribute_Form_AdditionalPayment->postProcess()
#21 /srv/www/4719/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php(169): CRM_Core_Form->mainProcess()
#22 /srv/www/4719/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php(136): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Contribute_Form_AdditionalPayment), "upload")
#23 /srv/www/4719/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Contribute_Form_AdditionalPayment), "upload")
#24 /srv/www/4719/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_AdditionalPayment), "upload")
#25 /srv/www/4719/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("upload")
#26 /srv/www/4719/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#27 /srv/www/4719/sites/all/modules/civicrm/CRM/Core/Invoke.php(284): CRM_Utils_Wrapper->run("CRM_Contribute_Form_AdditionalPayment", "New Payment", NULL)
#28 /srv/www/4719/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15))
#29 /srv/www/4719/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#30 /srv/www/4719/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:3))
#31 [internal function](): civicrm_invoke("payment", "add")
#32 /srv/www/4719/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
#33 /srv/www/4719/index.php(21): menu_execute_active_handler()
#34 {main}