diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index e811902760..c620ba9596 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -119,16 +119,16 @@ static function update($item, $fields) { static function check_for_conflicts($item, $new_name, $new_slug) { $errors = array(); - if ($row = Database::instance() + if ($row = db::build() ->select(array("name", "slug")) ->from("items") ->where("parent_id", $item->parent_id) ->where("id <>", $item->id) - ->open_paren() + ->and_open() ->where("name", $new_name) ->orwhere("slug", $new_slug) - ->close_paren() - ->get() + ->close() + ->execute() ->current()) { if ($row->name == $new_name) { $errors["name_conflict"] = 1;