diff --git a/module/VuFind/src/VuFind/Db/Row/User.php b/module/VuFind/src/VuFind/Db/Row/User.php index a01db720d1505d9355472d0be943d2246bc3647a..a0de0e5de28d5af9f9d3248de6429f313d4debda 100644 --- a/module/VuFind/src/VuFind/Db/Row/User.php +++ b/module/VuFind/src/VuFind/Db/Row/User.php @@ -237,12 +237,12 @@ class User extends RowGateway implements \VuFind\Db\Table\DbTableAwareInterface, * @param int $listId Filter for tags tied to a specific list (null for no * filter). * @param string $source Filter for tags tied to a specific record source. + * (null for no filter). * * @return \Zend\Db\ResultSet\AbstractResultSet */ - public function getTags($resourceId = null, $listId = null, - $source = DEFAULT_SEARCH_BACKEND - ) { + public function getTags($resourceId = null, $listId = null, $source = null) + { return $this->getDbTable('Tags') ->getForUser($this->id, $resourceId, $listId, $source); } @@ -255,13 +255,13 @@ class User extends RowGateway implements \VuFind\Db\Table\DbTableAwareInterface, * for no filter). * @param int $listId Filter for tags tied to a specific list (null for no * filter). - * @param string $source Filter for tags tied to a specific record source. + * @param string $source Filter for tags tied to a specific record source + * (null for no filter). * * @return string */ - public function getTagString($resourceId = null, $listId = null, - $source = DEFAULT_SEARCH_BACKEND - ) { + public function getTagString($resourceId = null, $listId = null, $source = null) + { $myTagList = $this->getTags($resourceId, $listId, $source); $tagStr = ''; if (count($myTagList) > 0) { diff --git a/module/VuFind/src/VuFind/Db/Table/Tags.php b/module/VuFind/src/VuFind/Db/Table/Tags.php index 6512d925eefba92cab4562c4143bed60e29085b2..c9c7ec672c06237303f8275d188d95b63807d708 100644 --- a/module/VuFind/src/VuFind/Db/Table/Tags.php +++ b/module/VuFind/src/VuFind/Db/Table/Tags.php @@ -272,12 +272,13 @@ class Tags extends Gateway * for no filter). * @param int $listId Filter for tags tied to a specific list (null for no * filter). - * @param string $source Filter for tags tied to a specific record source. + * @param string $source Filter for tags tied to a specific record source + * (null for no filter). * * @return \Zend\Db\ResultSet\AbstractResultSet */ public function getForUser($userId, $resourceId = null, $listId = null, - $source = DEFAULT_SEARCH_BACKEND + $source = null ) { $callback = function ($select) use ($userId, $resourceId, $listId, $source) { $select->columns( @@ -310,8 +311,11 @@ class Tags extends Gateway ->equalTo( 'ur.list_id', 'rt.list_id', Predicate::TYPE_IDENTIFIER, Predicate::TYPE_IDENTIFIER - ) - ->equalTo('r.source', $source); + ); + + if (null !== $source) { + $select->where->equalTo('r.source', $source); + } if (null !== $resourceId) { $select->where->equalTo('r.record_id', $resourceId);