]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make loading of tags from DB more explicit.
authorBernhard Reiter <ockham@raz.or.at>
Fri, 10 Oct 2014 21:18:43 +0000 (23:18 +0200)
committerBernhard Reiter <ockham@raz.or.at>
Mon, 13 Oct 2014 22:06:07 +0000 (00:06 +0200)
lib/private/tags.php

index 5768f19cf21e97ade4a174978e21d7dde37d1405..05fb117036ac102c3e181c73a507681ca020b4c6 100644 (file)
@@ -121,14 +121,6 @@ class Tags implements \OCP\ITags {
                        $this->owners = array_merge($this->owners, \OC\Share\Share::getSharedItemsOwners($this->user, $this->type, true));
                        $this->backend = \OC\Share\Share::getBackend($this->type);
                }
-               $this->loadTags($defaultTags);
-       }
-
-       /**
-       * Load tags from db.
-       *
-       */
-       protected function loadTags($defaultTags=array()) {
                $this->tags = $this->mapper->loadTags($this->owners, $this->type);
 
                if(count($defaultTags) > 0 && count($this->tags) === 0) {
@@ -413,7 +405,9 @@ class Tags implements \OCP\ITags {
                        }
 
                        // reload tags to get the proper ids.
-                       $this->loadTags();
+                       $this->tags = $this->mapper->loadTags($this->owners, $this->type);
+                       \OCP\Util::writeLog('core', __METHOD__.', tags: ' . print_r($this->tags, true),
+                               \OCP\Util::DEBUG);
                        // Loop through temporarily cached objectid/tagname pairs
                        // and save relations.
                        $tags = $this->tags;