Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.8
-
Fix Version/s: 4.7.10
-
Component/s: None
-
Labels:
-
Documentation Required?:None
-
Sprint:4.7.10 Financials
-
Funding Source:Contributed Code
Description
To reproduce this:
1. Create a custom data group for Contributions of a particular type, e.g. "Event Fees", and create at least one searchable custom field in that group.
2. Ensure Financial ACLs are enabled (Adminster > CiviContribute > CiviContribute Component Settings; and check "Enable Access Control by Financial Type").
3. Open a Contribution report such as "Contribution Details", and ensure there's a filter set for the custom data field you created in step 1. Click to apply criteria and preview the report.
4. Observe a fatal error.
Backtrace:
#0 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Core/Error.php(182): CRM_Core_Error::backtrace() #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error)) #2 /var/www/d7cividev/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error)) #3 /var/www/d7cividev/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: no such field", -19, 16, (Array:2), "CREATE TEMPORARY TABLE civicrm_contribution_temp AS SELECT contribution_civir...") #4 /var/www/d7cividev/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-19, 16, (Array:2), "CREATE TEMPORARY TABLE civicrm_contribution_temp AS SELECT contribution_civir...") #5 /var/www/d7cividev/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "CREATE TEMPORARY TABLE civicrm_contribution_temp AS SELECT contribution_civir...", "DB_Error", TRUE) #6 /var/www/d7cividev/sites/all/modules/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'value_crm_18977_4_civireport.test_1_7' in 'where clause'") #7 /var/www/d7cividev/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError() #8 /var/www/d7cividev/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("CREATE TEMPORARY TABLE civicrm_contribution_temp AS SELECT contribution_civir...") #9 /var/www/d7cividev/sites/all/modules/civicrm/packages/DB/DataObject.php(2435): DB_common->query("CREATE TEMPORARY TABLE civicrm_contribution_temp AS SELECT contribution_civir...") #10 /var/www/d7cividev/sites/all/modules/civicrm/packages/DB/DataObject.php(1627): DB_DataObject->_query("CREATE TEMPORARY TABLE civicrm_contribution_temp AS SELECT contribution_civir...") #11 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Core/DAO.php(344): DB_DataObject->query("CREATE TEMPORARY TABLE civicrm_contribution_temp AS SELECT contribution_civir...") #12 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Core/DAO.php(1265): CRM_Core_DAO->query("CREATE TEMPORARY TABLE civicrm_contribution_temp AS SELECT contribution_civir...", TRUE) #13 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Report/Form.php(4569): CRM_Core_DAO::executeQuery("CREATE TEMPORARY TABLE civicrm_contribution_temp AS SELECT contribution_civir...") #14 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Report/Form/Contribute/Detail.php(385): CRM_Report_Form->getPermissionedFTQuery(Object(CRM_Report_Form_Contribute_Detail)) #15 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Report/Form/Contribute/Detail.php(590): CRM_Report_Form_Contribute_Detail->from(TRUE) #16 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Core/Form.php(423): CRM_Report_Form_Contribute_Detail->postProcess() #17 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Submit.php(74): CRM_Core_Form->mainProcess() #18 /var/www/d7cividev/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Submit->perform(Object(CRM_Report_Form_Contribute_Detail), "submit") #19 /var/www/d7cividev/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Report_Form_Contribute_Detail), "submit") #20 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("submit") #21 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run() #22 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Report/Page/Instance.php(89): CRM_Utils_Wrapper->run("CRM_Report_Form_Contribute_Detail", NULL, NULL) #23 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Report_Page_Instance->run((Array:4), NULL) #24 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:14)) #25 /var/www/d7cividev/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:4)) #26 /var/www/d7cividev/sites/all/modules/civicrm/drupal/civicrm.module(451): CRM_Core_Invoke::invoke((Array:4)) #27 [internal function](): civicrm_invoke("report", "instance", "8") #28 /var/www/d7cividev/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:3)) #29 /var/www/d7cividev/index.php(21): menu_execute_active_handler() #30 {main}
Error message:
Sorry but we are not able to provide this at the moment. DB Error: no such field Error Details Database Error Code: Unknown column 'value_crm_18977_4_civireport.test_1_7' in 'where clause', 1054 Additional Details: Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -19 [message] => DB Error: no such field [mode] => 16 [debug_info] => CREATE TEMPORARY TABLE civicrm_contribution_temp AS SELECT contribution_civireport.id FROM civicrm_contact contact_civireport INNER JOIN civicrm_contribution contribution_civireport ON contact_civireport.id = contribution_civireport.contact_id AND contribution_civireport.is_test = 0 LEFT JOIN civicrm_line_item line_item_civireport ON contribution_civireport.id = line_item_civireport.contribution_id AND line_item_civireport.entity_table = 'civicrm_contribution' AND line_item_civireport.financial_type_id NOT IN (3,1,4,2) WHERE (1) AND ( contribution_civireport.contribution_status_id IN (1) ) AND ( ( value_crm_18977_4_civireport.test_1_7 IN ( '1') ) ) AND contact_civireport.is_deleted = 0 AND contribution_civireport.financial_type_id IN (3,1,4,2) AND line_item_civireport.id IS NULL GROUP BY contribution_civireport.id [nativecode=1054 ** Unknown column 'value_crm_18977_4_civireport.test_1_7' in 'where clause'] [type] => DB_Error [user_info] => CREATE TEMPORARY TABLE civicrm_contribution_temp AS SELECT contribution_civireport.id FROM civicrm_contact contact_civireport INNER JOIN civicrm_contribution contribution_civireport ON contact_civireport.id = contribution_civireport.contact_id AND contribution_civireport.is_test = 0 LEFT JOIN civicrm_line_item line_item_civireport ON contribution_civireport.id = line_item_civireport.contribution_id AND line_item_civireport.entity_table = 'civicrm_contribution' AND line_item_civireport.financial_type_id NOT IN (3,1,4,2) WHERE (1) AND ( contribution_civireport.contribution_status_id IN (1) ) AND ( ( value_crm_18977_4_civireport.test_1_7 IN ( '1') ) ) AND contact_civireport.is_deleted = 0 AND contribution_civireport.financial_type_id IN (3,1,4,2) AND line_item_civireport.id IS NULL GROUP BY contribution_civireport.id [nativecode=1054 ** Unknown column 'value_crm_18977_4_civireport.test_1_7' in 'where clause'] [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TEMPORARY TABLE civicrm_contribution_temp AS SELECT contribution_civireport.id FROM civicrm_contact contact_civireport INNER JOIN civicrm_contribution contribution_civireport ON contact_civireport.id = contribution_civireport.contact_id AND contribution_civireport.is_test = 0 LEFT JOIN civicrm_line_item line_item_civireport ON contribution_civireport.id = line_item_civireport.contribution_id AND line_item_civireport.entity_table = 'civicrm_contribution' AND line_item_civireport.financial_type_id NOT IN (3,1,4,2) WHERE (1) AND ( contribution_civireport.contribution_status_id IN (1) ) AND ( ( value_crm_18977_4_civireport.test_1_7 IN ( '1') ) ) AND contact_civireport.is_deleted = 0 AND contribution_civireport.financial_type_id IN (3,1,4,2) AND line_item_civireport.id IS NULL GROUP BY contribution_civireport.id [nativecode=1054 ** Unknown column 'value_crm_18977_4_civireport.test_1_7' in 'where clause']"] )