diff options
author | Chad Kieffer <ckieffer@gmail.com> | 2011-04-24 23:05:03 -0600 |
---|---|---|
committer | Chad Kieffer <ckieffer@gmail.com> | 2011-04-24 23:05:03 -0600 |
commit | 1950f9c46652d76b8734df3b08bfcf4a4ffeb6fb (patch) | |
tree | 02a8d49d17f6a86fb2dec0019e9fc00ef0bc34e9 | |
parent | 8e7a8fd2dc3245c2d236a2cd33d8c1a61ef9963c (diff) | |
parent | 15f4657452795c2852c58c9f1840ce4e1f58d401 (diff) |
Merge branch 'master' of git://github.com/gallery/gallery3
-rw-r--r-- | .build_number | 2 | ||||
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 9 | ||||
-rw-r--r-- | modules/tag/models/tag.php | 9 |
3 files changed, 11 insertions, 9 deletions
diff --git a/.build_number b/.build_number index befc7f03..ce9a62d4 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=130 +build_number=132 diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 23fb29e5..e9c19c9d 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -518,12 +518,11 @@ class g2_import_Core { static function set_album_highlight(&$queue) { // Dequeue the current album and enqueue its children list($g2_album_id, $children) = each($queue); - if (empty($children)) { - return; - } unset($queue[$g2_album_id]); - foreach ($children as $key => $value) { - $queue[$key] = $value; + if (!empty($children)) { + foreach ($children as $key => $value) { + $queue[$key] = $value; + } } $messages = array(); 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"]); |