Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-20534

DB query syntax error while accessing event's Fee tab

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.7.18, 4.7.19
    • Fix Version/s: None
    • Component/s: CiviEvent
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      Recently I've updated my CiviCRM installation (Drupal 7) to version 4.7.18. Seems like there were some enhancements related to Financial Types. Now, when I'm trying to access the Fee tab on an event edit page (e.g. en/civicrm/event/manage/fee?reset=1&action=update&id=52) I'm getting a DB query syntax error:

      
      SELECT id, entity_id FROM civicrm_entity_financial_account WHERE ( account_relationship = AND  entity_table = 'civicrm_financial_type' ) ORDER BY entity_id

      (There's missing value in the condition.)
      Also, there's the same error when trying to edit a price scheme. Couldn't find anything like the issue I have on Google.

       

      The problem origins in CRM/Event/Form/ManageEvent/Fee.php:824 ($this->addSelect('financial_type_id')) which in turn leads to CRM/Event/Form/ManageEvent/Form.php:2359. There's a function called with the following parameters:   

      $info = civicrm_api3('Event', 'getoptions', ['entity' => Event, 'field' => financial_type_id, 'context' => 'create']);

      This is a function the query syntax error is thrown in.

       

      I've tried updating CiviCRM to 4.7.19 but now I'm getting even more error messages:

       

      $Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -19 [message] => DB Error: no such field [mode] => 16 [debug_info] => SELECT civicrm_custom_field_de_DE.id as civicrm_custom_field_id, civicrm_custom_field_de_DE.label as civicrm_custom_field_label, civicrm_custom_field_de_DE.column_name as civicrm_custom_field_column_name, civicrm_custom_field_de_DE.data_type as civicrm_custom_field_data_type, civicrm_custom_field_de_DE.html_type as civicrm_custom_field_html_type, civicrm_custom_field_de_DE.default_value as civicrm_custom_field_default_value, civicrm_custom_field_de_DE.attributes as civicrm_custom_field_attributes, civicrm_custom_field_de_DE.is_required as civicrm_custom_field_is_required, civicrm_custom_field_de_DE.is_view as civicrm_custom_field_is_view, civicrm_custom_field_de_DE.help_pre as civicrm_custom_field_help_pre, civicrm_custom_field_de_DE.help_post as civicrm_custom_field_help_post, civicrm_custom_field_de_DE.options_per_line as civicrm_custom_field_options_per_line, civicrm_custom_field_de_DE.start_date_years as civicrm_custom_field_start_date_years, civicrm_custom_field_de_DE.end_date_years as civicrm_custom_field_end_date_years, civicrm_custom_field_de_DE.date_format as civicrm_custom_field_date_format, civicrm_custom_field_de_DE.time_format as civicrm_custom_field_time_format, civicrm_custom_field_de_DE.option_group_id as civicrm_custom_field_option_group_id, civicrm_custom_field_de_DE.in_selector as civicrm_custom_field_in_selector, civicrm_custom_group_de_DE.id as civicrm_custom_group_id, civicrm_custom_group_de_DE.name as civicrm_custom_group_name, civicrm_custom_group_de_DE.table_name as civicrm_custom_group_table_name, civicrm_custom_group_de_DE.title as civicrm_custom_group_title, civicrm_custom_group_de_DE.help_pre as civicrm_custom_group_help_pre, civicrm_custom_group_de_DE.help_post as civicrm_custom_group_help_post, civicrm_custom_group_de_DE.collapse_display as civicrm_custom_group_collapse_display, civicrm_custom_group_de_DE.style as civicrm_custom_group_style, civicrm_custom_group_de_DE.is_multiple as civicrm_custom_group_is_multiple, civicrm_custom_group_de_DE.extends as civicrm_custom_group_extends, civicrm_custom_group_de_DE.extends_entity_column_id as civicrm_custom_group_extends_entity_column_id, civicrm_custom_group_de_DE.extends_entity_column_value as civicrm_custom_group_extends_entity_column_value, civicrm_custom_group_de_DE.max_multiple as civicrm_custom_group_max_multiple, civicrm_custom_group_de_DE.is_public as civicrm_custom_group_is_public FROM civicrm_custom_group_de_DE LEFT JOIN civicrm_custom_field_de_DE ON (civicrm_custom_field_de_DE.custom_group_id = civicrm_custom_group_de_DE.id) WHERE civicrm_custom_group_de_DE.is_active = 1 AND civicrm_custom_field_de_DE.is_active = 1 AND civicrm_custom_group_de_DE.extends IN ('Event') AND (((civicrm_custom_group_de_DE.extends_entity_column_value LIKE "%5%")) OR civicrm_custom_group_de_DE.extends_entity_column_value IS NULL ) AND civicrm_custom_group_de_DE.style = 'Inline' AND ( 1 ) AND civicrm_custom_group_de_DE.is_public = 1 ORDER BY civicrm_custom_group_de_DE.weight, civicrm_custom_group_de_DE.title, civicrm_custom_field_de_DE.weight, civicrm_custom_field_de_DE.label [nativecode=1054 ** Unknown column 'civicrm_custom_group_de_DE.is_public' in 'field list'] [type] => DB_Error [user_info] => SELECT civicrm_custom_field_de_DE.id as civicrm_custom_field_id, civicrm_custom_field_de_DE.label as civicrm_custom_field_label, civicrm_custom_field_de_DE.column_name as civicrm_custom_field_column_name, civicrm_custom_field_de_DE.data_type as civicrm_custom_field_data_type, civicrm_custom_field_de_DE.html_type as civicrm_custom_field_html_type, civicrm_custom_field_de_DE.default_value as civicrm_custom_field_default_value, civicrm_custom_field_de_DE.attributes as civicrm_custom_field_attributes, civicrm_custom_field_de_DE.is_required as civicrm_custom_field_is_required, civicrm_custom_field_de_DE.is_view as civicrm_custom_field_is_view, civicrm_custom_field_de_DE.help_pre as civicrm_custom_field_help_pre, civicrm_custom_field_de_DE.help_post as civicrm_custom_field_help_post, civicrm_custom_field_de_DE.options_per_line as civicrm_custom_field_options_per_line, civicrm_custom_field_de_DE.start_date_years as civicrm_custom_field_start_date_years, civicrm_custom_field_de_DE.end_date_years as civicrm_custom_field_end_date_years, civicrm_custom_field_de_DE.date_format as civicrm_custom_field_date_format, civicrm_custom_field_de_DE.time_format as civicrm_custom_field_time_format, civicrm_custom_field_de_DE.option_group_id as civicrm_custom_field_option_group_id, civicrm_custom_field_de_DE.in_selector as civicrm_custom_field_in_selector, civicrm_custom_group_de_DE.id as civicrm_custom_group_id, civicrm_custom_group_de_DE.name as civicrm_custom_group_name, civicrm_custom_group_de_DE.table_name as civicrm_custom_group_table_name, civicrm_custom_group_de_DE.title as civicrm_custom_group_title, civicrm_custom_group_de_DE.help_pre as civicrm_custom_group_help_pre, civicrm_custom_group_de_DE.help_post as civicrm_custom_group_help_post, civicrm_custom_group_de_DE.collapse_display as civicrm_custom_group_collapse_display, civicrm_custom_group_de_DE.style as civicrm_custom_group_style, civicrm_custom_group_de_DE.is_multiple as civicrm_custom_group_is_multiple, civicrm_custom_group_de_DE.extends as civicrm_custom_group_extends, civicrm_custom_group_de_DE.extends_entity_column_id as civicrm_custom_group_extends_entity_column_id, civicrm_custom_group_de_DE.extends_entity_column_value as civicrm_custom_group_extends_entity_column_value, civicrm_custom_group_de_DE.max_multiple as civicrm_custom_group_max_multiple, civicrm_custom_group_de_DE.is_public as civicrm_custom_group_is_public FROM civicrm_custom_group_de_DE LEFT JOIN civicrm_custom_field_de_DE ON (civicrm_custom_field_de_DE.custom_group_id = civicrm_custom_group_de_DE.id) WHERE civicrm_custom_group_de_DE.is_active = 1 AND civicrm_custom_field_de_DE.is_active = 1 AND civicrm_custom_group_de_DE.extends IN ('Event') AND (((civicrm_custom_group_de_DE.extends_entity_column_value LIKE "%5%")) OR civicrm_custom_group_de_DE.extends_entity_column_value IS NULL ) AND civicrm_custom_group_de_DE.style = 'Inline' AND ( 1 ) AND civicrm_custom_group_de_DE.is_public = 1 ORDER BY civicrm_custom_group_de_DE.weight, civicrm_custom_group_de_DE.title, civicrm_custom_field_de_DE.weight, civicrm_custom_field_de_DE.label [nativecode=1054 ** Unknown column 'civicrm_custom_group_de_DE.is_public' in 'field list'] [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT civicrm_custom_field_de_DE.id as civicrm_custom_field_id, civicrm_custom_field_de_DE.label as civicrm_custom_field_label, civicrm_custom_field_de_DE.column_name as civicrm_custom_field_column_name, civicrm_custom_field_de_DE.data_type as civicrm_custom_field_data_type, civicrm_custom_field_de_DE.html_type as civicrm_custom_field_html_type, civicrm_custom_field_de_DE.default_value as civicrm_custom_field_default_value, civicrm_custom_field_de_DE.attributes as civicrm_custom_field_attributes, civicrm_custom_field_de_DE.is_required as civicrm_custom_field_is_required, civicrm_custom_field_de_DE.is_view as civicrm_custom_field_is_view, civicrm_custom_field_de_DE.help_pre as civicrm_custom_field_help_pre, civicrm_custom_field_de_DE.help_post as civicrm_custom_field_help_post, civicrm_custom_field_de_DE.options_per_line as civicrm_custom_field_options_per_line, civicrm_custom_field_de_DE.start_date_years as civicrm_custom_field_start_date_years, civicrm_custom_field_de_DE.end_date_years as civicrm_custom_field_end_date_years, civicrm_custom_field_de_DE.date_format as civicrm_custom_field_date_format, civicrm_custom_field_de_DE.time_format as civicrm_custom_field_time_format, civicrm_custom_field_de_DE.option_group_id as civicrm_custom_field_option_group_id, civicrm_custom_field_de_DE.in_selector as civicrm_custom_field_in_selector, civicrm_custom_group_de_DE.id as civicrm_custom_group_id, civicrm_custom_group_de_DE.name as civicrm_custom_group_name, civicrm_custom_group_de_DE.table_name as civicrm_custom_group_table_name, civicrm_custom_group_de_DE.title as civicrm_custom_group_title, civicrm_custom_group_de_DE.help_pre as civicrm_custom_group_help_pre, civicrm_custom_group_de_DE.help_post as civicrm_custom_group_help_post, civicrm_custom_group_de_DE.collapse_display as civicrm_custom_group_collapse_display, civicrm_custom_group_de_DE.style as civicrm_custom_group_style, civicrm_custom_group_de_DE.is_multiple as civicrm_custom_group_is_multiple, civicrm_custom_group_de_DE.extends as civicrm_custom_group_extends, civicrm_custom_group_de_DE.extends_entity_column_id as civicrm_custom_group_extends_entity_column_id, civicrm_custom_group_de_DE.extends_entity_column_value as civicrm_custom_group_extends_entity_column_value, civicrm_custom_group_de_DE.max_multiple as civicrm_custom_group_max_multiple, civicrm_custom_group_de_DE.is_public as civicrm_custom_group_is_public FROM civicrm_custom_group_de_DE LEFT JOIN civicrm_custom_field_de_DE ON (civicrm_custom_field_de_DE.custom_group_id = civicrm_custom_group_de_DE.id) WHERE civicrm_custom_group_de_DE.is_active = 1 AND civicrm_custom_field_de_DE.is_active = 1 AND civicrm_custom_group_de_DE.extends IN ('Event') AND (((civicrm_custom_group_de_DE.extends_entity_column_value LIKE "%5%")) OR civicrm_custom_group_de_DE.extends_entity_column_value IS NULL ) AND civicrm_custom_group_de_DE.style = 'Inline' AND ( 1 ) AND civicrm_custom_group_de_DE.is_public = 1 ORDER BY civicrm_custom_group_de_DE.weight, civicrm_custom_group_de_DE.title, civicrm_custom_field_de_DE.weight, civicrm_custom_field_de_DE.label [nativecode=1054 ** Unknown column 'civicrm_custom_group_de_DE.is_public' in 'field list']"] ) 
      
      
      $backTrace = #0 sites/all/modules/civicrm/CRM/Core/Error.php(229): CRM_Core_Error::backtrace("backTrace", TRUE) #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error)) #2 sites/all/modules/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error)) #3 sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "SELECT civicrm_custom_field_de_DE.id as civicrm_custom_field_id, civicrm_cust...") #4 sites/all/modules/civicrm/packages/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "SELECT civicrm_custom_field_de_DE.id as civicrm_custom_field_id, civicrm_cust...") #5 [internal function](): PEAR->_raiseError(Object(DB_mysqli), NULL, -19, NULL, NULL, "SELECT civicrm_custom_field_de_DE.id as civicrm_custom_field_id, civicrm_cust...", "DB_Error", TRUE) #6 sites/all/modules/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8)) #7 sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7)) #8 sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "SELECT civicrm_custom_field_de_DE.id as civicrm_custom_field_id, civicrm_cust...", "DB_Error", TRUE) #9 sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'civicrm_custom_group_de_DE.is_public' in 'field list'") #10 sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError() #11 sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("SELECT civicrm_custom_field_de_DE.id as civicrm_custom_field_id, civicrm_cust...") #12 sites/all/modules/civicrm/packages/DB/DataObject.php(2446): DB_common->query("SELECT civicrm_custom_field_de_DE.id as civicrm_custom_field_id, civicrm_cust...") #13 sites/all/modules/civicrm/packages/DB/DataObject.php(1635): DB_DataObject->_query("SELECT civicrm_custom_field_de_DE.id as civicrm_custom_field_id, civicrm_cust...") #14 sites/all/modules/civicrm/CRM/Core/DAO.php(357): DB_DataObject->query("SELECT civicrm_custom_field_de_DE.id as civicrm_custom_field_id, civicrm_cust...") #15 sites/all/modules/civicrm/CRM/Core/DAO.php(1307): CRM_Core_DAO->query("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...", TRUE) #16 sites/all/modules/civicrm/CRM/Core/BAO/CustomGroup.php(537): CRM_Core_DAO::executeQuery("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...", (Array:0)) #17 sites/all/modules/civicrm/CRM/Event/Page/EventInfo.php(185): CRM_Core_BAO_CustomGroup::getTree("Event", Object(CRM_Event_Page_EventInfo), "76", 0, "5", NULL, TRUE, NULL, FALSE, TRUE, NULL, TRUE) #18 sites/all/modules/civicrm/CRM/Core/Invoke.php(310): CRM_Event_Page_EventInfo->run((Array:3), NULL) #19 sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15)) #20 sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3)) #21 sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:3)) #22 [internal function](): civicrm_invoke("event", "info") #23 includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2)) #24 index.php(21): menu_execute_active_handler() #25 {main} 

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              adrianp Adrian P
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: