diff options
| author | colings <colings@example.com> | 2011-02-13 10:46:43 -0600 |
|---|---|---|
| committer | colings <colings@example.com> | 2011-02-13 10:46:43 -0600 |
| commit | d759d47ef99ebde158620f43ab46a83f445d9e53 (patch) | |
| tree | 4b4f9a53d721ac02e8762d9c543ad479faa97bae /modules/tag/models | |
| parent | 02a349f68ac480d5b1a630e14b4f2e3558328673 (diff) | |
| parent | d2c77fd0590501f7b6b51d9f4cc033ed9485b082 (diff) | |
Merge remote branch 'upstream/master'
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 25df87e0..53ccc856 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 @@ -78,12 +78,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(); |
