2

This is likely an error that has come about as part of an upgrade. We went from CiviCRM 5.31 to 5.44 about a month ago and everything appeared to go well with the incremental database updates, etc.

However, when merging contacts in Civi, we now get a traceback with the following error:

[nativecode=1146 ** Table 'fthdc_civi.civicrm_translation' doesn't exist]

I won't paste the whole trace, but the start of the SQL query is:

(SELECT 'civicrm_translation' as civicrm_table, 'entity_id' as field_name FROM civicrm_translation WHERE entity_table = 'civicrm_contact' LIMIT 1) UNION (SELECT ...

Checking the database, it's true that the civicrm_translation table doesn't appear to exist.

Questions are:

  1. When did the civicrm_translation table appear in Civi?
  2. Is this something that should have been created in the upgrade process?
  3. Is there anything that I can do to create this table and the necessary data in order to make merging contacts start working again?

Also, is this a bug that needs reporting?

Thanks in anticipation.

1 Answer 1

4

It sounds like the upgrade didn't fully work. It gets created as part of 5.39: https://github.com/civicrm/civicrm-core/blob/bbc91a6b38e98b488867a3438d0ac0ee3f4f03c6/CRM/Upgrade/Incremental/sql/5.39.alpha1.mysql.tpl#L3

CREATE TABLE IF NOT EXISTS `civicrm_translation` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique String ID',
  `entity_table` varchar(64) NOT NULL COMMENT 'Table where referenced item is stored',
  `entity_field` varchar(64) NOT NULL COMMENT 'Field where referenced item is stored',
  `entity_id` int NOT NULL COMMENT 'ID of the relevant entity.',
  `language` varchar(5) NOT NULL COMMENT 'Relevant language',
  `status_id` tinyint NOT NULL DEFAULT 1 COMMENT 'Specify whether the string is active, draft, etc',
  `string` longtext NOT NULL COMMENT 'Translated string',
  PRIMARY KEY (`id`),
  INDEX `index_entity_lang`(entity_id, entity_table, language)
)
ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
2
  • 1
    Thank you thank you! Ran the SQL and tried merging a contact - seems to be working again now.
    – Rich Smith
    Feb 4, 2022 at 15:31
  • It would be worth checking other updates around that one to see if just that one failed or if a larger selection on updates were not done. You seem to have fixed the immediate error but you may encounter future weirdness if other updates were missed.
    – Aidan
    Feb 7, 2022 at 13:05

Your Answer

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

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