Merge pull request #6154 from JakubOnderka/tags-fix

chg: [internal] Initialize UserSetting just when needed
pull/6161/head
Sami Mokaddem 2020-07-30 08:27:58 +02:00 committed by GitHub
commit e6c863efae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {