diff options
Diffstat (limited to 'modules/tag')
-rw-r--r-- | modules/tag/controllers/admin_tags.php | 2 | ||||
-rw-r--r-- | modules/tag/helpers/tag.php | 4 | ||||
-rw-r--r-- | modules/tag/models/tag.php | 8 | ||||
-rw-r--r-- | modules/tag/tests/Tag_Test.php | 6 |
4 files changed, 10 insertions, 10 deletions
diff --git a/modules/tag/controllers/admin_tags.php b/modules/tag/controllers/admin_tags.php index aff44803..6cd2f337 100644 --- a/modules/tag/controllers/admin_tags.php +++ b/modules/tag/controllers/admin_tags.php @@ -106,7 +106,7 @@ class Admin_Tags_Controller extends Admin_Controller { } public function check_for_duplicate(Validation $post_data, $field) { - $tag_exists = ORM::factory("tag")->where("name", $post_data[$field])->count_all(); + $tag_exists = ORM::factory("tag")->where("name", "=", $post_data[$field])->count_all(); if ($tag_exists) { $post_data->add_error($field, "in_use"); } diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index 8694bcec..c4c4ba15 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -33,7 +33,7 @@ class tag_Core { throw new exception("@todo MISSING_TAG_NAME"); } - $tag = ORM::factory("tag")->where("name", $tag_name)->find(); + $tag = ORM::factory("tag")->where("name", "=", $tag_name)->find(); if (!$tag->loaded()) { $tag->name = $tag_name; $tag->count = 0; @@ -93,7 +93,7 @@ class tag_Core { ->select("name") ->from("tags") ->join("items_tags", "tags.id", "items_tags.tag_id", "left") - ->where("items_tags.item_id", $item->id) + ->where("items_tags.item_id", "=", $item->id) ->get() as $row) { $tags[] = $row->name; } diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php index be020f5f..f9a453be 100644 --- a/modules/tag/models/tag.php +++ b/modules/tag/models/tag.php @@ -31,9 +31,9 @@ class Tag_Model extends ORM { $model = ORM::factory("item") ->viewable() ->join("items_tags", "items.id", "items_tags.item_id") - ->where("items_tags.tag_id", $this->id); + ->where("items_tags.tag_id", "=", $this->id); if ($type) { - $model->where("items.type", $type); + $model->where("items.type", "=", $type); } return $model->find_all($limit, $offset); } @@ -47,10 +47,10 @@ class Tag_Model extends ORM { $model = ORM::factory("item") ->viewable() ->join("items_tags", "items.id", "items_tags.item_id") - ->where("items_tags.tag_id", $this->id); + ->where("items_tags.tag_id", "=", $this->id); if ($type) { - $model->where("items.type", $type); + $model->where("items.type", "=", $type); } return $model->count_all(); } diff --git a/modules/tag/tests/Tag_Test.php b/modules/tag/tests/Tag_Test.php index c9a96286..c96e7f2b 100644 --- a/modules/tag/tests/Tag_Test.php +++ b/modules/tag/tests/Tag_Test.php @@ -25,18 +25,18 @@ class Tag_Test extends Unit_Test_Case { $tag1 = "tag1"; tag::add($album, $tag1); - $tag = ORM::factory("tag")->where("name", $tag1)->find(); + $tag = ORM::factory("tag")->where("name", "=", $tag1)->find(); $this->assert_true(1, $tag->count); // Make sure adding the tag again doesn't increase the count tag::add($album, $tag1); - $tag = ORM::factory("tag")->where("name", $tag1)->find(); + $tag = ORM::factory("tag")->where("name", "=", $tag1)->find(); $this->assert_true(1, $tag->count); $rand = rand(); $album = album::create($root, $rand, $rand, $rand); tag::add($album, $tag1); - $tag = ORM::factory("tag")->where("name", $tag1)->find(); + $tag = ORM::factory("tag")->where("name", "=", $tag1)->find(); $this->assert_true(2, $tag->count); } }
\ No newline at end of file |