// Fix multishop in objectModel (langs were not correctly generated when an employee has not all auths on shops)
This commit is contained in:
@@ -473,7 +473,9 @@ abstract class ObjectModelCore
|
|||||||
if (!empty($this->def['multilang']))
|
if (!empty($this->def['multilang']))
|
||||||
{
|
{
|
||||||
$fields = $this->getFieldsLang();
|
$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))
|
if ($fields && is_array($fields))
|
||||||
foreach ($fields as $field)
|
foreach ($fields as $field)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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
|
* Get shops list
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user