// Fix default id lang in localization packs
This commit is contained in:
@@ -58,7 +58,11 @@ class LocalizationPackCore
|
||||
$res &= $this->_installLanguages($xml, $install_mode);
|
||||
|
||||
if ($res && isset($this->iso_code_lang))
|
||||
Configuration::updateValue('PS_LANG_DEFAULT', (int)Language::getIdByIso($this->iso_code_lang));
|
||||
{
|
||||
if (!$id_lang = (int)Language::getIdByIso($this->iso_code_lang))
|
||||
$id_lang = 1;
|
||||
Configuration::updateValue('PS_LANG_DEFAULT', $id_lang);
|
||||
}
|
||||
|
||||
if ($install_mode && $res && isset($this->iso_currency))
|
||||
{
|
||||
|
||||
+2
-2
@@ -25,8 +25,8 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (file_exists(dirname(__FILE__).'/../config/settings.inc.php'))
|
||||
include_once(dirname(__FILE__).'/../config/settings.inc.php');
|
||||
if (file_exists(dirname(__FILE__).'/../../config/settings.inc.php'))
|
||||
include_once(dirname(__FILE__).'/../../config/settings.inc.php');
|
||||
|
||||
abstract class DbCore
|
||||
{
|
||||
|
||||
@@ -186,7 +186,8 @@ class InstallModelInstall extends InstallAbstractModel
|
||||
}
|
||||
|
||||
$flip_languages = array_flip($languages);
|
||||
Configuration::updateGlobalValue('PS_LANG_DEFAULT', $flip_languages[$this->language->getLanguageIso()]);
|
||||
$id_lang = (!empty($flip_languages[$this->language->getLanguageIso()])) ? $flip_languages[$this->language->getLanguageIso()] : 1;
|
||||
Configuration::updateGlobalValue('PS_LANG_DEFAULT', $id_lang);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user