fix: [internal] Do not throw warning when user don't have collections

pull/6939/head
Jakub Onderka 2021-02-01 15:09:37 +01:00
parent 73a8a973c7
commit 67037f140d
1 changed files with 11 additions and 2 deletions

View File

@ -63,7 +63,7 @@ class TagCollection extends AppModel
return true;
}
public function fetchTagCollection($user, $params = array())
public function fetchTagCollection(array $user, $params = array())
{
if (empty($user['Role']['perm_site_admin'])) {
$params['conditions']['AND'][] = array(
@ -104,8 +104,17 @@ class TagCollection extends AppModel
return true;
}
public function cullBlockedTags($user, $tagCollections)
/**
* @param array $user
* @param array $tagCollections
* @return array|
*/
public function cullBlockedTags(array $user, array $tagCollections)
{
if (empty($tagCollection)) {
return [];
}
$single = false;
if (!isset($tagCollections[0])) {
$tagCollections = array(0 => $tagCollections);