summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/gallery/models/item.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index fcd9b8e6..e04b1314 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -839,8 +839,8 @@ class Item_Model extends ORM_MPTT {
if (db::build()
->from("items")
->where("parent_id", "=", $this->parent_id)
- ->where("id", "<>", $this->id)
->where("name", "=", $this->name)
+ ->merge_where($this->id ? array(array("id", "<>", $this->id)) : null)
->count_records()) {
$v->add_error("name", "conflict");
}