From c1528d1c5bf82d1a637fa6ac8b245e2a565f5f59 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 5 Aug 2011 06:33:40 +0200 Subject: we can retrieve system tags now --- src/SemanticScuttle/Service/Bookmark2Tag.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/SemanticScuttle') diff --git a/src/SemanticScuttle/Service/Bookmark2Tag.php b/src/SemanticScuttle/Service/Bookmark2Tag.php index 914abc6..3e5c533 100644 --- a/src/SemanticScuttle/Service/Bookmark2Tag.php +++ b/src/SemanticScuttle/Service/Bookmark2Tag.php @@ -271,10 +271,11 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService * Retrieves all tags for a given bookmark except system tags. * * @param integer $bookmarkid ID of the bookmark + * @param boolean $systemTags Return "system:*" tags or not * * @return array Array of tags */ - public function getTagsForBookmark($bookmarkid) + public function getTagsForBookmark($bookmarkid, $systemTags = false) { if (!is_numeric($bookmarkid)) { message_die( @@ -285,9 +286,11 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService } $query = 'SELECT tag FROM ' . $this->getTableName() - . ' WHERE bId = ' . intval($bookmarkid) - . ' AND LEFT(tag, 7) <> "system:"' - . ' ORDER BY id ASC'; + . ' WHERE bId = ' . intval($bookmarkid); + if (!$systemTags) { + $query .= ' AND LEFT(tag, 7) <> "system:"'; + } + $query .= ' ORDER BY id ASC'; if (!($dbresult = $this->db->sql_query($query))) { message_die( -- cgit v1.2.3-54-g00ecf From 9c18fe1cc7e22077763baa545144cc01d5d94eab Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 5 Aug 2011 06:47:37 +0200 Subject: Fix bug #3386178: "system:unfiled" secret tag does not work --- doc/ChangeLog | 1 + src/SemanticScuttle/Service/Tag.php | 1 + tests/Bookmark2TagTest.php | 9 +++++++++ 3 files changed, 11 insertions(+) (limited to 'src/SemanticScuttle') diff --git a/doc/ChangeLog b/doc/ChangeLog index b512d3c..d71a3d0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -6,6 +6,7 @@ ChangeLog for SemantiScuttle 0.98.2 - 2011-08-XX ------------------- - Fix bug #3385724: Rename tag ends with XML Parsing Error +- Fix bug #3386178: "system:unfiled" secret tag does not work 0.98.1 - 2011-08-01 diff --git a/src/SemanticScuttle/Service/Tag.php b/src/SemanticScuttle/Service/Tag.php index 8325285..2476608 100644 --- a/src/SemanticScuttle/Service/Tag.php +++ b/src/SemanticScuttle/Service/Tag.php @@ -143,6 +143,7 @@ class SemanticScuttle_Service_Tag extends SemanticScuttle_DbService if(!is_array($tags)) { $tags = utf8_strtolower(trim($tags)); } else { + $tags = array_filter($tags);//remove empty values for($i=0; $iaddBookmark(null, null, 0, array('')); + $this->assertEquals( + array('system:unfiled'), + $this->b2ts->getTagsForBookmark($bid, true) + ); + } + /** -- cgit v1.2.3-54-g00ecf