summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/photo.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers/photo.php')
-rw-r--r--modules/gallery/helpers/photo.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php
index 21cb13a0..2a563043 100644
--- a/modules/gallery/helpers/photo.php
+++ b/modules/gallery/helpers/photo.php
@@ -89,11 +89,11 @@ class photo_Core {
// Randomize the name or slug if there's a conflict
// @todo Improve this. Random numbers are not user friendly
while (ORM::factory("item")
- ->where("parent_id", $parent->id)
- ->open_paren()
- ->where("name", $photo->name)
- ->orwhere("slug", $photo->slug)
- ->close_paren()
+ ->where("parent_id", "=", $parent->id)
+ ->and_open()
+ ->where("name", "=", $photo->name)
+ ->orwhere("slug", "=", $photo->slug)
+ ->close()
->find()->id) {
$rand = rand();
$photo->name = "{$name}.$rand.{$pi['extension']}";