In valid_name, don't query on the id if it's null.

This commit is contained in:
Bharat Mediratta
2010-01-18 13:09:58 -08:00
parent f492436317
commit 1cfee16e38

View File

@@ -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");
}