Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading multilingual site causes DB Error #12636

Merged
merged 2 commits into from
Aug 29, 2018
Merged

Upgrading multilingual site causes DB Error #12636

merged 2 commits into from
Aug 29, 2018

Conversation

chamilwijesooriya
Copy link
Contributor

GitLab Issue 311 - Upgrading multilingual site causes DB Error

Overview

Upgrading from CiviCRM 4.4.7 to 5.4.0 (Drupal), cause a DB error. Upgrade process works fine.

Before

When loading any civi page, JavaScript error is displayed on the language file (backtrace displayed after enabling).

javascript

Checking the error log, few fields relating to uf_group are not getting created during the upgrade.

errorlog

Further investigation showed that in CRM/Core/I18n, there have been schema changes between the latest SchemaStructure.php and SchemaStructure_4_7_alpha1.php

schemastructure

After

Copied CRM/Core/I18n/SchemaStructure.php and renamed to SchemaStructure_5_4_alpha1.php

@civibot
Copy link

civibot bot commented Aug 8, 2018

(Standard links)

* @return array
* A table-indexed array of translatable columns.
*/
public static function &columns() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a general pattern - we have been removing the & in lines like above for a while now. It's there in old code so I understand you copying it in - but we don't think it's a good thing

@eileenmcnaughton
Copy link
Contributor

How does this work?

Note that in 4.7.31 a new multilingual field was added - for multilingual upgraders running the api
System.rebuildmultilingualschema should work - not ideal but....

@seamuslee001 @mlutfy thoughts

@mlutfy
Copy link
Member

mlutfy commented Aug 9, 2018

This would explain why we need to run rebuildmultilingualschema after upgrades. It's possible that the new DB Schema does not get loaded by the upgrader, so when it rebuilds the schema, it does not include the frontend_title in the view.

It might have been better to name it SchemaStructure_4_7_31.php, but since we don't support old versions anyway, this isn't a big deal.

@chamilwijesooriya
Copy link
Contributor Author

@eileenmcnaughton oh didn't know about the API call.. couldn't find in the docs

I just followed what's mentioned in the docs here

docs

and I guess this is the code where it choses which schema structure to load in CRM/Core/I18n/Schema.php

code

@eileenmcnaughton
Copy link
Contributor

@chamilwijesooriya wow - I had no idea that was there - did you @seamuslee001 @mlutfy

@eileenmcnaughton
Copy link
Contributor

@seamuslee001 I think this is mergeable ....

@mlutfy
Copy link
Member

mlutfy commented Aug 29, 2018

Seems OK to me as well

@seamuslee001
Copy link
Contributor

Seems sensible to me, I say we merge it

@colemanw
Copy link
Member

If it's a regression, should it go in 5.5?

@eileenmcnaughton
Copy link
Contributor

@colemanw it's not a recent regression - it has affected the whole 5.x series as it was 4.7.31

@mlutfy mlutfy merged commit 9c7f255 into civicrm:master Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants