// Fix multishop in objectModel (langs were not correctly generated when an employee has not all auths on shops)

This commit is contained in:
rMalie
2012-05-21 19:12:35 +00:00
parent 462a8eb1f2
commit 3eb2308503
2 changed files with 12 additions and 1 deletions
+3 -1
View File
@@ -473,7 +473,9 @@ abstract class ObjectModelCore
if (!empty($this->def['multilang']))
{
$fields = $this->getFieldsLang();
$shops = Shop::getShops(true, null, true);
// @todo : try to do something better than this
$shops = Shop::getCompleteListOfShopsID();
if ($fields && is_array($fields))
foreach ($fields as $field)
{
+9
View File
@@ -497,6 +497,15 @@ class ShopCore extends ObjectModel
}
}
public static function getCompleteListOfShopsID()
{
$list = array();
$sql = 'SELECT id_shop FROM '._DB_PREFIX_.'shop';
foreach (Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql) as $row)
$list[] = $row['id_shop'];
return $list;
}
/**
* Get shops list
*