1

after upgrading to CiviCRM 4.7.23 for Wordpress I can no longer configure Event Fees and get a DB Error: syntax error.

I tried upgrading to 4.7.24 and still no joy.

The log file contains this:

    Sep 28 12:41:10  [info] $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 MySQL 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 MySQL 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 MySQL server version for the right syntax to use near 'AND entity_table = 'civicrm_financial_type'  )  


 ORDER BY entity_id' at line 4]"]
)

I have since found more issues which may be related.

I can no longer edit or add Payment Processors and get an error saying: This financial account cannot have '' relationship.

I also can't add or edit Price Sets.

Further digging found this in my tracestack:

/wp-content/plugins/civicrm/civicrm/CRM/Financial/BAO/FinancialType.php(196): CRM_Core_PseudoConstant::populate(NULL, "CRM_Financial_DAO_EntityFinancialAccount", TRUE, "entity_id", NULL, "account_relationship = AND entity_table = 'civicrm_financial_type' ")

  • Is it possible you installed an extension that adds a payment processor (e.g. Stripe), created a payment processor, then uninstalled/deleted the extension without deleting the payment processor record? – Jon G - Megaphone Tech Sep 29 '17 at 4:58
  • Hi, thanks for the response. Unfortunately this is not the case as I only ever used the built in Paypal payment processor. – Slingshot Design Oct 2 '17 at 9:05
5

I guess you have disabled the CiviContribute Component which lead the function to return NULL for account relationship.

0

If you can reproduce this [and give us your exact steps] on one of the demo sites (Wordpress or Drupal - http://dmaster.demo.civicrm.org/civicrm - does not really matter) - then this (a Fatal Error) will get prompt attention; There are several code Sprints going on this week - reporting live from Montreal!

  • Thanks for the link, that's really useful. I couldn't reproduce the problem. However I have since found another issue which may be related. I can no longer edit or add Payment Processors. If I try I get an error saying: This financial account cannot have '' relationship. I can't try to reproduce this on the demo as I do not have enough permission to make those changes. – Slingshot Design Sep 28 '17 at 14:13
  • Ah - so that sounds like the underlying issue - perhaps somehow some Financial Accounts got deleted? – KarinG - Semper IT Sep 29 '17 at 10:58
  • Thanks for your reply. I've compared all of the financial tables with a backup of my database and they are exactly the same apart from 2 extra records in the civicdm_finalncial_account table in the newest database. I tried deleting them but made no difference. – Slingshot Design Oct 2 '17 at 9:34
0

Similar issue when CiviContribute is disabled is with price sets: menu for new price set is active, but throws a DB syntax error when new price set is submitted.

See more here: CiviMember price sets are depending on CiviContribute?

  • Thanks Doka - could you expand this to make it clearly an Answer eg "therefore disable Price Sets before disabling CiviContribute"? – petednz - fuzion Feb 20 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.