Make a languageicons.install with a languageicons_update_[1|6000]() {}, unsetting i18n_icon_* and setting languageicons_* instead.

Comments

Freso’s picture

Title: Upgrade path from i18n_icon_* to languageicons_* » Upgrade path from i18n_icon_* to languageicons_* + language_uninstall()
Status: Active » Needs review

Here's a complete .install - including a languageicons_uninstall() for removing the site variables when removing the module.

Freso’s picture

StatusFileSize
new1.27 KB

Eh. Let's try that again.

Freso’s picture

StatusFileSize
new1.3 KB

And here's a small update, making it call variable_get() only once (per variable to convert) and fixing a bug due to not following up on the if (...) with {. :$

Freso’s picture

StatusFileSize
new1.59 KB

Added a bit of logic to make the update reset the ..._path variable if it was using the default one (drupal_get_path('module', 'i18n') .'/flags/*.png'), so that Drupal/the module will use the new location for the files. I'm not sure about this part of the update though, so feedback would be appreciated. :)

Freso’s picture

StatusFileSize
new1.58 KB

And here's my final bid, which I have actually tested and am therefore rather confident that it works. Now I just need to know whether to drop the _path if it is == drupal_get_path('module', 'i18n') .'/flags/*.png' or not (the current behaviour is that it does drop it (instead of converting it)).

Freso’s picture

StatusFileSize
new1.7 KB

And here's a wee update. This one will only set languageicons_* if they're not already set - if they are, it'll just delete the old i18n_icon_* variable. A bit more logic about the *_path variable was also added.

Freso’s picture

Title: Upgrade path from i18n_icon_* to languageicons_* + language_uninstall() » Upgrade path from i18n_icon_* to languageicons_*
StatusFileSize
new1.86 KB

I split the languageicons_uninstall() off into its own issue: #294819: Remove site variables in languageicons_uninstall()

Also, since that one has already been committed: a re-roll, now as an actual patch!

jose reyero’s picture

Status: Needs review » Reviewed & tested by the community

Looks great to me, seems you haven't forgotten anything

Go ahead

Freso’s picture

Status: Reviewed & tested by the community » Fixed

Alright, excellent - it's been committed. :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.