chg: [internal] Initialize UserSetting just when needed

pull/6154/head
Jakub Onderka 2020-07-28 16:10:31 +02:00
parent d4c7374a03
commit bd1a2247e0
1 changed files with 1 additions and 1 deletions

View File

@ -427,8 +427,8 @@ class Tag extends AppModel
public function checkForOverride($tags)
{
$userId = Configure::read('CurrentUserId');
$this->UserSetting = ClassRegistry::init('UserSetting');
if ($this->tagOverrides === false && $userId > 0) {
$this->UserSetting = ClassRegistry::init('UserSetting');
$this->tagOverrides = $this->UserSetting->getTagNumericalValueOverride($userId);
}
foreach ($tags as $k => $tag) {