Commit 611af51d authored by catch's avatar catch

Issue #532512 by Sutharsan: Follow-up for plural string storage upgrade path.

parent efc984df
......@@ -386,6 +386,7 @@ function locale_update_8005() {
}
$plural_lids = array_unique($plural_lids);
if (!empty($plural_lids)) {
// Look up all translations for these source strings. Ordering by language
// will group the strings by language, the 'plid' order will get the
// strings in singular/plural order and 'plural' will get them in precise
......@@ -468,6 +469,7 @@ function locale_update_8005() {
db_delete('locales_target')
->condition('lid', $remove_lids, 'IN')
->execute();
}
// Drop the primary key because it contains 'plural'.
db_drop_primary_key('locales_target');
......
......@@ -136,4 +136,18 @@ class LanguageUpgradePathTestCase extends UpgradePathTestCase {
$domains = locale_language_negotiation_url_domains();
$this->assertTrue($domains['ca'] == $language_domain, t('Language domain for Catalan properly upgraded.'));
}
/**
* Tests upgrading translations without plurals.
*/
public function testLanguageNoPluralsUpgrade() {
// Remove all plural translations from the database.
db_delete('locales_target')->condition('plural', 0, '<>')->execute();
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
// Check if locale_update_8005() is succesfully completed by checking
// whether index 'plural' has been removed.
$this->assertFalse(db_index_exists('locales_target', 'plural'), t('Translations without plurals upgraded.'));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment