diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2011-04-27 19:30:00 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2011-04-27 19:30:00 -0700 |
commit | 4e20e71d0375ed65d75dbdb12113f737db90b3e7 (patch) | |
tree | 51d15ed4ac3ee4f44886f94ed8c3197c76d050ac /modules/tag | |
parent | 7f48671186a4bf3a4745cd7a31b48a891dd83078 (diff) | |
parent | 7577d02fe2f2c37a79caf6a32b246f5a046c917a (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/tag')
-rw-r--r-- | modules/tag/models/tag.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php index 13e253ba..bb79e707 100644 --- a/modules/tag/models/tag.php +++ b/modules/tag/models/tag.php @@ -75,8 +75,12 @@ class Tag_Model_Core extends ORM { ->where("id", "!=", $this->id) ->find(); if ($duplicate_tag->loaded()) { - // If so, tag its items with this tag so as to merge it. - foreach ($duplicate_tag->items() as $item) { + // If so, tag its items with this tag so as to merge it + $duplicate_tag_items = ORM::factory("item") + ->join("items_tags", "items.id", "items_tags.item_id") + ->where("items_tags.tag_id", "=", $duplicate_tag->id) + ->find_all(); + foreach ($duplicate_tag_items as $item) { $this->add($item); } @@ -84,7 +88,6 @@ class Tag_Model_Core extends ORM { $duplicate_tag->delete(); } - // Figure out what items have changed in this tag for our item_related_update event below if (isset($this->object_relations["items"])) { $added = array_diff($this->changed_relations["items"], $this->object_relations["items"]); $removed = array_diff($this->object_relations["items"], $this->changed_relations["items"]); |