diff options
author | Nathan Kinkade <nkinkade@nkinka.de> | 2011-01-31 20:49:25 +0000 |
---|---|---|
committer | Nathan Kinkade <nkinkade@nkinka.de> | 2011-01-31 20:49:25 +0000 |
commit | de6f3fce9110b777d61dec97f2a3a61d887a5ccd (patch) | |
tree | 1a184dc0d6bbfd644164d85d3df1bc9926455da7 /modules/tag/models | |
parent | 2898fe3b82ce10d045dd2c274a3290bacf209a00 (diff) | |
parent | d2c77fd0590501f7b6b51d9f4cc033ed9485b082 (diff) |
Did a git pull, but had to manually merge a conflict.
Diffstat (limited to 'modules/tag/models')
-rw-r--r-- | modules/tag/models/tag.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php index 06620ae2..1f233038 100644 --- a/modules/tag/models/tag.php +++ b/modules/tag/models/tag.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access."); /** * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2010 Bharat Mediratta + * Copyright (C) 2000-2011 Bharat Mediratta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -79,12 +79,14 @@ class Tag_Model_Core extends ORM { $related_item_ids[$row->item_id] = 1; } - $added = array_diff($this->changed_relations["items"], $this->object_relations["items"]); - $removed = array_diff($this->object_relations["items"], $this->changed_relations["items"]); - if (isset($this->changed_relations["items"])) { - $changed = array_merge($added, $removed); + 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"]); + if (isset($this->changed_relations["items"])) { + $changed = array_merge($added, $removed); + } + $this->count = count($this->object_relations["items"]) + count($added) - count($removed); } - $this->count = count($this->object_relations["items"]) + count($added) - count($removed); $result = parent::save(); |