Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Cannot Reproduce
-
Affects Version/s: 4.3.0
-
Fix Version/s: 4.3.0
-
Component/s: None
-
Labels:None
Description
I tried upgrading with triggers turned on for the first time to see if the upgrade script was now coping with this. It failed on the field name change on the contribution_type_id to financial_type_id
I tried disabling & re-enabling the triggers after the upgrade and did not hit this error. I did, however, find that the log_civicrm_financial_trxn.trxn_id field is set to 'NOT NULL' whereas civicrm_financial_trxn.trxn_id allows NULL - so was unable to record any contributions with logging on.
(sorry about the extra spaces below but you get the idea...)
CREATE TRIGGER civicrm_contribution_after_insert after in sert ON civicrm_contribution FOR EACH ROW BEGIN IF ( @civicrm_disable_logging I S NULL OR @civicrm_disable_logging = 0 ) THEN INSERT INTO `breastfeeding_staging_civi`.log_civicrm_contribution (id, contact_id, contribution_type_id, contribut ion_page_id, payment_instrument_id, receive_date, non_deductible_amount, total_amount, fee_amount, net_amount, trxn_id, invoice_id, currency, cancel_date, cancel_reason, receipt_date, thankyou_date, source, amount_level, contribution_recur_id, honor_contact_id, is_test, is_pay_later, contribution_status_id, honor_type_ id, address_id, check_number, campaign_id, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.contact_id, NEW.contribution_type_id, NEW.contribution_pag e_id, NEW.payment_instrument_id, NEW.receive_date, NEW.non_deductible_amount, NE W.total_amount, NEW.fee_amount, NEW.net_amount, NEW.trxn_id, NEW.invoice_id, NEW .currency, NEW.cancel_date, NEW.cancel_reason, NEW.receipt_date, NEW.thankyou_da te, NEW.source, NEW.amount_level, NEW.contribution_recur_id, NEW.honor_contact_i d, NEW.is_test, NEW.is_pay_later, NEW.contribution_status_id, NEW.honor_type_id, NEW.address_id, NEW.check_number, NEW.campaign_id, CONNECTION_ID(), @civicrm_us er_id, 'insert');END IF; END [nativecode=1054 ** Unknown column 'contribution_type_id' in 'NEW']
NB to get past financial_trxn I ran
ALTER TABLE `log_civicrm_financial_trxn`
CHANGE COLUMN `trxn_id` `trxn_id` VARCHAR(255) NULL COMMENT 'unique processor transaction id, bank id + trans id,... depending on payment_method' COLLATE 'utf8_unicode_ci' AFTER `payment_processor`;