Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.6.3
-
Fix Version/s: 4.6.5
-
Component/s: None
-
Labels:None
-
Documentation Required?:None
-
Funding Source:Core Team Funds
Description
Replicated on local 4.6 sandbox as follows:
1. Membership > Batch Data Entry
Batch type = Membership
2 transactions
$200 total
2. Select 'General' membership for both rows. Set Payment Status column = Completed for first row, Pending for second row. Validate and Save.
Fatal Error:
[debug_info] => INSERT INTO civicrm_entity_batch (entity_table , batch_id ) VALUES ('civicrm_financial_trxn' , 3 ) [nativecode=1364 ** Field 'entity_id' doesn't have a default value]
---- original post —
On dmaster or our demo site if I create a membership batch then I get the the following when I process it. NB on our site the first time 'seemed' to work & the second crashed. dmaster crashed the first time. I was testing to ensure https://github.com/civicrm/civicrm-core/pull/5943/files did not cause any regression on whether membership payments were treating as pending (the PR is intended to stop form assumptions not relevant to this form being applied to it).
Note that in my test I created a batch of 2 * membership transactions with a total of $200 & set one to pending @ $100 & the other to completed @ $100. On our demo site it didn't error or work the first time & the second time I got the error. On dmaster it errored the first time
#0 .../sites/all/modules/civicrm/CRM/Core/Error.php(182): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 .../sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 .../sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: unknown error", -1, 16, (Array:2), "INSERT INTO civicrm_entity_batch (entity_table , batch_id ) VALUES ('civicrm_...")
#4 .../sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-1, 16, (Array:2), "INSERT INTO civicrm_entity_batch (entity_table , batch_id ) VALUES ('civicrm_...")
#5 .../sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "INSERT INTO civicrm_entity_batch (entity_table , batch_id ) VALUES ('civicrm_...", "DB_Error", TRUE)
#6 .../sites/all/modules/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-1, NULL, NULL, NULL, "1364 ** Field 'entity_id' doesn't have a default value")
#7 .../sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 .../sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("INSERT INTO civicrm_entity_batch (entity_table , batch_id ) VALUES ('civicrm_...")
#9 .../sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("INSERT INTO civicrm_entity_batch (entity_table , batch_id ) VALUES ('civicrm_...")
#10 .../sites/all/modules/civicrm/packages/DB/DataObject.php(1060): DB_DataObject->query("INSERT INTO civicrm_entity_batch (entity_table , batch_id ) VALUES ('civicrm...")
#11 .../sites/all/modules/civicrm/CRM/Core/DAO.php(450): DB_DataObject->insert()
#12 .../sites/all/modules/civicrm/CRM/Batch/BAO/Batch.php(149): CRM_Core_DAO->save()
#13 .../sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(2937): CRM_Batch_BAO_Batch::addBatchEntity((Array:3))
#14 .../sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(192): CRM_Contribute_BAO_Contribution::recordFinancialAccounts((Array:25))
#15 .../sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(318): CRM_Contribute_BAO_Contribution::add((Array:25), (Array:0))
#16 .../sites/all/modules/civicrm/CRM/Member/BAO/Membership.php(2960): CRM_Contribute_BAO_Contribution::create((Array:25), (Array:0))
#17 .../sites/all/modules/civicrm/CRM/Member/BAO/Membership.php(329): CRM_Member_BAO_Membership::recordMembershipContribution((Array:28), (Array:0))
#18 .../sites/all/modules/civicrm/CRM/Batch/Form/Entry.php(800): CRM_Member_BAO_Membership::create((Array:28), (Array:0))
#19 .../sites/all/modules/civicrm/CRM/Batch/Form/Entry.php(409): CRM_Batch_Form_Entry->processMembership((Array:9))
#20 .../sites/all/modules/civicrm/CRM/Core/Form.php(345): CRM_Batch_Form_Entry->postProcess()
#21 .../sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php(166): CRM_Core_Form->mainProcess()
#22 .../sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php(133): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Batch_Form_Entry), "upload")
#23 .../sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Batch_Form_Entry), "upload")
#24 .../sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Batch_Form_Entry), "upload")
#25 .../sites/all/modules/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("upload")
#26 .../sites/all/modules/civicrm/CRM/Utils/Wrapper.php(115): CRM_Core_Controller->run()
#27 .../sites/all/modules/civicrm/CRM/Core/Invoke.php(286): CRM_Utils_Wrapper->run("CRM_Batch_Form_Entry", NULL, NULL)
#28 .../sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:12))
#29 .../sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#30 .../sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))