mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-04-30 01:59:11 -04:00
In valid_name, don't query on the id if it's null.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user