Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development

This commit is contained in:
Vincent Augagneur
2013-08-06 16:56:05 +02:00
3 changed files with 9 additions and 10 deletions
+5 -7
View File
@@ -858,15 +858,13 @@ abstract class ObjectModelCore
continue;
$values = $this->$field;
// If the object has not been loaded in multilanguage, then the value is the one for the current language of the object
if (!is_array($values))
{
$value = $values;
$values = array();
$values[$this->id_lang] = $value;
$values[Configuration::get('PS_LANG_DEFAULT')] = $value;
}
$values = array($this->id_lang => $values);
if (!isset($values[Configuration::get('PS_LANG_DEFAULT')]))
// The value for the default must always be set, so we put an empty string if it does not exists
if (!isset($values[Configuration::get('PS_LANG_DEFAULT')]))
$values[Configuration::get('PS_LANG_DEFAULT')] = '';
foreach ($values as $id_lang => $value)
+2
View File
@@ -1509,6 +1509,8 @@ class AdminControllerCore extends Controller
*/
protected function initTabModuleList()
{
if (!$this->isFresh(Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, 86400))
@file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, Tools::addonsRequest('must-have'));
if (!$this->isFresh(Module::CACHE_FILE_TAB_MODULES_LIST, 604800))
$this->refresh(Module::CACHE_FILE_TAB_MODULES_LIST, 'http://'.Tab::TAB_MODULE_LIST_URL);
@@ -722,9 +722,8 @@ class AdminTranslationsControllerCore extends AdminController
$arr_import_lang = explode('|', Tools::getValue('params_import_language')); /* 0 = Language ISO code, 1 = PS version */
if (Validate::isLangIsoCode($arr_import_lang[0]))
{
if ($content = Tools::file_get_contents(
'http://www.prestashop.com/download/lang_packs/gzip/'.$arr_import_lang[1].'/'.Tools::strtolower($arr_import_lang[0]).'.gzip', false,
@stream_context_create(array('http' => array('method' => 'GET', 'timeout' => 5)))))
$content = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/gzip/'.$arr_import_lang[1].'/'.Tools::strtolower($arr_import_lang[0]).'.gzip');
if ($content)
{
$file = _PS_TRANSLATIONS_DIR_.$arr_import_lang[0].'.gzip';
if ((bool)@file_put_contents($file, $content))