0

After upgrade to 5.4.0 (from 4.7) I'm seeing fatal DB errors ("no such field") when refreshing Contribution Detail & Summary reports. Debug log shows:

$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 ifnull(civicrm_contribution_financial_type_id, '') as civicrm_contribution_financial_type_id, ifnull(civicrm_contribution_payment_instrument_id, '') as civicrm_contribution_payment_instrument_id, ifnull(civicrm_contact_sort_name, '') as civicrm_contact_sort_name, ifnull(civicrm_contact_id, '') as civicrm_contact_id, ifnull(civicrm_contribution_contribution_id, '') as civicrm_contribution_contribution_id, ifnull(civicrm_contribution_financial_type_id, '') as civicrm_contribution_financial_type_id, ifnull(civicrm_contribution_payment_instrument_id, '') as civicrm_contribution_payment_instrument_id, ifnull(civicrm_contribution_currency, '') as civicrm_contribution_currency, ifnull(civicrm_contribution_receive_date, '') as civicrm_contribution_receive_date, ifnull(civicrm_contribution_total_amount, '') as civicrm_contribution_total_amount, ifnull(civicrm_contribution_fee_amount, '') as civicrm_contribution_fee_amount, ifnull(civicrm_contribution_net_amount, '') as civicrm_contribution_net_amount, ifnull(civicrm_contribution_contribution_or_soft, '') as civicrm_contribution_contribution_or_soft, ifnull(civicrm_contribution_campaign_id, '') as civicrm_contribution_campaign_id, ifnull(civicrm_value_gift_aid_declaration_custom_25, '') as civicrm_value_gift_aid_declaration_custom_25, ifnull(civicrm_value_gift_aid_declaration_custom_26, '') as civicrm_value_gift_aid_declaration_custom_26, ifnull(civicrm_value_gift_aid_declaration_custom_27, '') as civicrm_value_gift_aid_declaration_custom_27 , sum(civicrm_contribution_total_amount) as sumcontribs, count(*) as ct from civireport_contribution_detail_temp3 group by civicrm_contribution_financial_type_id, civicrm_contribution_payment_instrument_id [nativecode=1054 ** Unknown column 'civicrm_contribution_total_amount' in 'field list'] [type] => DB_Error [user_info] => SELECT ifnull(civicrm_contribution_financial_type_id, '') as civicrm_contribution_financial_type_id, ifnull(civicrm_contribution_payment_instrument_id, '') as civicrm_contribution_payment_instrument_id, ifnull(civicrm_contact_sort_name, '') as civicrm_contact_sort_name, ifnull(civicrm_contact_id, '') as civicrm_contact_id, ifnull(civicrm_contribution_contribution_id, '') as civicrm_contribution_contribution_id, ifnull(civicrm_contribution_financial_type_id, '') as civicrm_contribution_financial_type_id, ifnull(civicrm_contribution_payment_instrument_id, '') as civicrm_contribution_payment_instrument_id, ifnull(civicrm_contribution_currency, '') as civicrm_contribution_currency, ifnull(civicrm_contribution_receive_date, '') as civicrm_contribution_receive_date, ifnull(civicrm_contribution_total_amount, '') as civicrm_contribution_total_amount, ifnull(civicrm_contribution_fee_amount, '') as civicrm_contribution_fee_amount, ifnull(civicrm_contribution_net_amount, '') as civicrm_contribution_net_amount, ifnull(civicrm_contribution_contribution_or_soft, '') as civicrm_contribution_contribution_or_soft, ifnull(civicrm_contribution_campaign_id, '') as civicrm_contribution_campaign_id, ifnull(civicrm_value_gift_aid_declaration_custom_25, '') as civicrm_value_gift_aid_declaration_custom_25, ifnull(civicrm_value_gift_aid_declaration_custom_26, '') as civicrm_value_gift_aid_declaration_custom_26, ifnull(civicrm_value_gift_aid_declaration_custom_27, '') as civicrm_value_gift_aid_declaration_custom_27 , sum(civicrm_contribution_total_amount) as sumcontribs, count(*) as ct from civireport_contribution_detail_temp3 group by civicrm_contribution_financial_type_id, civicrm_contribution_payment_instrument_id [nativecode=1054 ** Unknown column 'civicrm_contribution_total_amount' 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 ifnull(civicrm_contribution_financial_type_id, '') as civicrm_contribution_financial_type_id, ifnull(civicrm_contribution_payment_instrument_id, '') as civicrm_contribution_payment_instrument_id, ifnull(civicrm_contact_sort_name, '') as civicrm_contact_sort_name, ifnull(civicrm_contact_id, '') as civicrm_contact_id, ifnull(civicrm_contribution_contribution_id, '') as civicrm_contribution_contribution_id, ifnull(civicrm_contribution_financial_type_id, '') as civicrm_contribution_financial_type_id, ifnull(civicrm_contribution_payment_instrument_id, '') as civicrm_contribution_payment_instrument_id, ifnull(civicrm_contribution_currency, '') as civicrm_contribution_currency, ifnull(civicrm_contribution_receive_date, '') as civicrm_contribution_receive_date, ifnull(civicrm_contribution_total_amount, '') as civicrm_contribution_total_amount, ifnull(civicrm_contribution_fee_amount, '') as civicrm_contribution_fee_amount, ifnull(civicrm_contribution_net_amount, '') as civicrm_contribution_net_amount, ifnull(civicrm_contribution_contribution_or_soft, '') as civicrm_contribution_contribution_or_soft, ifnull(civicrm_contribution_campaign_id, '') as civicrm_contribution_campaign_id, ifnull(civicrm_value_gift_aid_declaration_custom_25, '') as civicrm_value_gift_aid_declaration_custom_25, ifnull(civicrm_value_gift_aid_declaration_custom_26, '') as civicrm_value_gift_aid_declaration_custom_26, ifnull(civicrm_value_gift_aid_declaration_custom_27, '') as civicrm_value_gift_aid_declaration_custom_27 , sum(civicrm_contribution_total_amount) as sumcontribs, count(*) as ct from civireport_contribution_detail_temp3 group by civicrm_contribution_financial_type_id, civicrm_contribution_payment_instrument_id [nativecode=1054 ** Unknown column 'civicrm_contribution_total_amount' in 'field list']"] )

Key issue seems to be that civicrm_contribution_total_amount is not included in temp table civireport_contribution_detail_temp3

Checked on a 5.0 demo site listed on civicrm.org (https://drupal.demo.civicrmfr.org/civicrm/report/list?compid=2&reset=1 - the only one running 5.x) and get the same error.

Any help gratefully received...

1 Answer 1

0

For some reason i am getting different no such field error i.e for contact.birth_date. I have locked the issue for this error at https://lab.civicrm.org/dev/core/issues/325 and submitted PR at https://github.com/civicrm/civicrm-core/pull/12660 .

I also logged issue for your bug at https://lab.civicrm.org/dev/core/issues/326 which happens when we enable Section header under sorting tab.

To fix this temporary until Core team have PR for it, i would suggest you to turn off section header.

HTH

Pradeep

11
  • Interesting. I could replicate this on a French language 5.0 version on civicrm.org Commented Aug 14, 2018 at 15:14
  • On French site the error is for 'contact.birth_date' which i have fixed it in my PR. I could replicate the error you getting now. I have updated my answer Commented Aug 14, 2018 at 15:20
  • Interesting. I could replicate this on a French language 5.3.1 version on civicrm.org. (as above), by logging in (demo/demo) -> choose CiviCRM -> choose "Rapport des contributions" -> Choose "Contribution details" then "Rafraichir le resultats"... Gives: DB Error. Turning off Section Header had not impact. Still errored. Commented Aug 14, 2018 at 15:25
  • Can you turn off 'Age' and 'Sexe' field under columns and try doing a search without section header? Commented Aug 14, 2018 at 15:35
  • I've turned off all optional columns and section header, but still get the error. Commented Aug 14, 2018 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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