From 1cfee16e38b483d97dddc723b383f5c8cef0f229 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 18 Jan 2010 13:09:58 -0800 Subject: In valid_name, don't query on the id if it's null. --- modules/gallery/models/item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') 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"); } -- cgit v1.2.3