CiviEvent: Deactivating CiviContribute causes SQL error
When CiviContribute is deactivated, several actions (e.g. clearing the cache) cause an SQL error.
$Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => exceptionHandler ) [code] => -2 [message] => DB Error: syntax error [mode] => 16 [debug_info] => SELECT id, entity_id FROM civicrm_entity_financial_account WHERE ( account_relationship = AND entity_table = 'civicrm_financial_type' ) ORDER BY entity_id [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND entity_table = 'civicrm_financial_type' ) ORDER BY entity_id' at line 4] [type] => DB_Error [user_info] => SELECT id, entity_id FROM civicrm_entity_financial_account WHERE ( account_relationship = AND entity_table = 'civicrm_financial_type' ) ORDER BY entity_id [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND entity_table = 'civicrm_financial_type' ) ORDER BY entity_id' at line 4] [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="SELECT id, entity_id FROM civicrm_entity_financial_account WHERE ( account_relationship = AND entity_table = 'civicrm_financial_type' ) ORDER BY entity_id [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND entity_table = 'civicrm_financial_type' ) ORDER BY entity_id' at line 4]"] )
The account_relationship is not available when the module is deactivated. Therefor, the SQL is not proper:
WHERE ( account_relationship = AND entity_table = 'civicrm_financial_type')