backdrop-contrib / i18n

Collection of modules to extend Backdrop CMS multilingual capabilities
https://backdropcms.org/project/i18n
GNU General Public License v2.0
2 stars 5 forks source link

Ensure that textgroup is added back when upgrading from d7 #45

Closed herbdool closed 3 years ago

herbdool commented 3 years ago

I see that in i18n_string.install it will recreate the textgroup field in i18n_string_install() but for an upgrade that module is already installed. So perhaps also need it in an update hook that runs after textgroup is dropped in locale.install. (Unless we decide to revive it in core.)

indigoxela commented 3 years ago

See also this meta issue for upgrade paths: https://github.com/backdrop-contrib/i18n/issues/33

indigoxela commented 3 years ago

I think, several people did weird things over the years. What we actually should use is hook_schema_alter() - or am I missing something?

herbdool commented 3 years ago

Maybe, but I think hook_schema_alter only gets called on an install. Here we are doing it on an upgrade where it might already be installed.

indigoxela commented 3 years ago

Weird idea: we currently lose all data with locale_update_1000(). What if we clone the whole table before that hook and move back the table after that, so following locale update hooks run, but we keep all data?

indigoxela commented 3 years ago

I'd prefer to do these experiments on a branch: https://github.com/backdrop-contrib/i18n/tree/d7-upgrade-path

@herbdool what do you think?

This is the change

indigoxela commented 3 years ago

Branch d7-upgrade-path has been merged into 1.x-1.x, which addresses the textgroup problem.