]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Fix bug getTagsForBookmarks() that fetched all tags, see http://sourceforge.net/proje...
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 9 Jul 2010 10:04:35 +0000 (10:04 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 9 Jul 2010 10:04:35 +0000 (10:04 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@715 b3834d28-1941-0410-a4f8-b48e95affb8f

doc/ChangeLog
src/SemanticScuttle/Service/Bookmark2Tag.php
tests/Bookmark2TagTest.php

index 5b4e4d3fa73a5073f99b6fb1b53589e56a870fdc..5e24f076fc8e509d58cb9562fc47b344058ae884 100644 (file)
@@ -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
index d6c0e5897f5a4f2b30c85ad6ba266026ffb8a50c..4d2c969b955359a3d214b1692765f2cabf283e50 100644 (file)
@@ -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';
 
index 0afaaf8a91042b20fad8b1b62f3c0bd6cdae7498..14b71cc518703747c7ad461cb655666481fff042 100644 (file)
@@ -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)
         );