aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/ChangeLog5
-rw-r--r--src/SemanticScuttle/Service/Bookmark2Tag.php7
-rw-r--r--tests/Bookmark2TagTest.php6
3 files changed, 12 insertions, 6 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 5b4e4d3..5e24f07 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,6 +1,11 @@
ChangeLog for SemantiScuttle
============================
+0.9X.X - 2010-XX-XX
+-------------------
+- Fix bug getTagsForBookmarks() that fetched all tags
+
+
0.97.0 - 2010-06-09
-------------------
- Many SQL optimizations - SemanticScuttle shows bookmarks 4 times faster now
diff --git a/src/SemanticScuttle/Service/Bookmark2Tag.php b/src/SemanticScuttle/Service/Bookmark2Tag.php
index d6c0e58..4d2c969 100644
--- a/src/SemanticScuttle/Service/Bookmark2Tag.php
+++ b/src/SemanticScuttle/Service/Bookmark2Tag.php
@@ -325,13 +325,8 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService
return array();
}
- $sql = '';
- foreach ($bookmarkids as $bookmarkid) {
- $sql .= ' OR bId = ' . intval($bookmarkid);
- }
-
$query = 'SELECT tag, bId FROM ' . $this->getTableName()
- . ' WHERE (1' . $sql . ')'
+ . ' WHERE bId IN (' . implode(',', $bookmarkids) . ')'
. ' AND LEFT(tag, 7) <> "system:"'
. ' ORDER BY id, bId ASC';
diff --git a/tests/Bookmark2TagTest.php b/tests/Bookmark2TagTest.php
index 0afaaf8..14b71cc 100644
--- a/tests/Bookmark2TagTest.php
+++ b/tests/Bookmark2TagTest.php
@@ -171,6 +171,12 @@ class Bookmark2TagTest extends TestBase
$bid4 = $this->addBookmark(null, null, 0, array());
//no tags
+ //bookmark that does not get queried
+ //http://sourceforge.net/projects/semanticscuttle/forums/forum/759510/topic/3752670
+ $bid5 = $this->addBookmark(null, null, 0, array());
+ $this->b2ts->attachTags($bid5, array('foo', 'bar2', 'fuu5'));
+
+
$alltags = $this->b2ts->getTagsForBookmarks(
array($bid1, $bid2, $bid3, $bid4)
);