summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/item.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-12-27 08:32:12 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-12-27 08:32:12 -0800
commitbccb6fc02146fb07cd1b472a90092e78e2259e91 (patch)
tree78dcb1717e020ebc65fec8a4ba452ab1193d2a27 /modules/gallery/helpers/item.php
parent07e83718a0cd1bcef1f0a0546ffcb7cb6a1735ae (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.php8
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()) {