2

We are getting a DB Error: no such field error when registering for a paid event. Here is the debug info which indicated a problem with an unknown column in the contributions table I think. I have looked and that field is in the table. We are using CiviCRM 4.7.30 on Joomla 3.8.7

Database Error Code: Unknown column 'invoice_number' in 'field list', 1054 Additional Details:

Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle )

[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] => INSERT INTO civicrm_contribution (contact_id , financial_type_id , payment_instrument_id , receive_date , total_amount , fee_amount , net_amount , invoice_id , currency , source , amount_level , is_test , is_pay_later , contribution_status_id , check_number , tax_amount ) VALUES ( 17049 ,  6 ,  1 ,  20180501090413 ,  50 ,  0 ,  50 , '5e4ba6329f63217b6b65a068eafabfe1' , 'USD' , 'Online Event Registration: Childrens Camp (1st - 7th Grades) 2018 Counselor and Staff Application' , 'Application Fee - 1' ,  0 ,  0 ,  2 ,  NULL ,  0 )  [nativecode=1054 ** Unknown column 'invoice_number' in 'field list']
[type] => DB_Error
[user_info] => INSERT INTO civicrm_contribution (contact_id , financial_type_id , payment_instrument_id , receive_date , total_amount , fee_amount , net_amount , invoice_id , currency , source , amount_level , is_test , is_pay_later , contribution_status_id , check_number , tax_amount ) VALUES ( 17049 ,  6 ,  1 ,  20180501090413 ,  50 ,  0 ,  50 , '5e4ba6329f63217b6b65a068eafabfe1' , 'USD' , 'Online Event Registration: Childrens Camp (1st - 7th Grades) 2018 Counselor and Staff Application' , 'Application Fee - 1' ,  0 ,  0 ,  2 ,  NULL ,  0 )  [nativecode=1054 ** Unknown column 'invoice_number' in 'field list']
[to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_contribution (contact_id , financial_type_id , payment_instrument_id , receive_date , total_amount , fee_amount , net_amount , invoice_id , currency , source , amount_level , is_test , is_pay_later , contribution_status_id , check_number , tax_amount ) VALUES ( 17049 ,  6 ,  1 ,  20180501090413 ,  50 ,  0 ,  50 , '5e4ba6329f63217b6b65a068eafabfe1' , 'USD' , 'Online Event Registration: Childrens Camp (1st - 7th Grades) 2018 Counselor and Staff Application' , 'Application Fee - 1' ,  0 ,  0 ,  2 ,  NULL ,  0 )  [nativecode=1054 ** Unknown column 'invoice_number' in 'field list']"]

)

1

This is because of a missing field in the contribution log table. See the following question and answer for next steps: How can I deal with a missing or corrupt binary ("advanced") log table?

So if you don't care about existing logs, you should just be able to turn logging off then back on, otherwise that post gives some more advice.

For either step, I'd suggest backing up your database first just in case something gets more corrupted.

  • 1
    Actually turning logging off & back on will not lose any data (the tables are not recreated but extra fields are added when you turn back on). You do stand to lose any logging data you would have otherwise captured over the few minutes while you are turning it off & on – user4278 May 2 '18 at 23:15
0

Invoice number is a field that was added some releases earlier than the version you are on - perhaps you need to run the upgrade script by hitting civicrm/upgrade url - although I'm not quite sure how to construct that url in Joomla!

  • I have attempted that but i get an error message that indicates the database has already been upgraded to 4.7.30. I also checked the table and that field is present. – Tom Barnes May 2 '18 at 15:09
  • 1
    Might be a trigger that is corrupted. Try SHOW TRIGGERS and see if any reference invoice_number. I say this because the query in the question post doesn't even use the field directly. – Demerit May 2 '18 at 15:33
  • How do I show triggers – Tom Barnes May 2 '18 at 18:39
  • 1
    It's a mysql command, so however you access your database, e.g. phpmyadmin. – Demerit May 2 '18 at 18:51
  • There is an after insert trigger that copies all of the cells to the contribution log table. I checked and that table does not have the invoice_number field. Sounds like either a bug or the database did not update completely. How do you suggest I resolve it? – Tom Barnes May 2 '18 at 21:55

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.