diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-27 08:32:12 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-27 08:32:12 -0800 |
commit | bccb6fc02146fb07cd1b472a90092e78e2259e91 (patch) | |
tree | 78dcb1717e020ebc65fec8a4ba452ab1193d2a27 /modules/gallery/helpers/item.php | |
parent | 07e83718a0cd1bcef1f0a0546ffcb7cb6a1735ae (diff) |
Clean up validation the check for duplicate names or slugs, finish converting the rest API to Kohana 2.4
Diffstat (limited to 'modules/gallery/helpers/item.php')
-rw-r--r-- | modules/gallery/helpers/item.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index c620ba95..fc390e70 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -122,11 +122,11 @@ class item_Core { if ($row = db::build() ->select(array("name", "slug")) ->from("items") - ->where("parent_id", $item->parent_id) - ->where("id <>", $item->id) + ->where("parent_id", "=", $item->parent_id) + ->where("id", "<>", $item->id) ->and_open() - ->where("name", $new_name) - ->orwhere("slug", $new_slug) + ->where("name", "=", $new_name) + ->or_where("slug", "=", $new_slug) ->close() ->execute() ->current()) { |