mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 19:43:16 +00:00
Merge pull request #837 from romainneutron/fix-1618
[3.8] Fix user settings precedence
This commit is contained in:
@@ -1320,16 +1320,6 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
$sql = 'SELECT prop, value FROM usr_settings WHERE usr_id= :id';
|
||||
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||
$stmt->execute(array(':id' => $this->id));
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
foreach ($rs as $row) {
|
||||
$this->_prefs[$row['prop']] = $row['value'];
|
||||
}
|
||||
|
||||
foreach (self::$def_values as $k => $v) {
|
||||
if (!isset($this->_prefs[$k])) {
|
||||
if ($k == 'start_page_query' && $this->app['phraseanet.registry']->get('GV_defaultQuery')) {
|
||||
@@ -1351,6 +1341,16 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
);
|
||||
}
|
||||
|
||||
$sql = 'SELECT prop, value FROM usr_settings WHERE usr_id= :id';
|
||||
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||
$stmt->execute(array(':id' => $this->id));
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
foreach ($rs as $row) {
|
||||
$this->_prefs[$row['prop']] = $row['value'];
|
||||
}
|
||||
|
||||
$this->preferences_loaded = true;
|
||||
|
||||
return $this;
|
||||
|
Reference in New Issue
Block a user