summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/item.php17
-rw-r--r--modules/gallery/helpers/item_rest.php8
2 files changed, 11 insertions, 14 deletions
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php
index 0710d8b2..6a740de4 100644
--- a/modules/gallery/helpers/item.php
+++ b/modules/gallery/helpers/item.php
@@ -43,17 +43,6 @@ class item_Core {
// Moving may result in name or slug conflicts. If that happens, try up to 5 times to pick a
// random name (or slug) to avoid the conflict.
- $message = item::save_with_retries($source);
-
- // If the target has no cover item, make this it.
- if ($target->album_cover_item_id == null) {
- item::make_album_cover($source);
- }
-
- return $message;
- }
-
- static function save_with_retries($source, $retries=5) {
$orig_name = $source->name;
$orig_name_filename = pathinfo($source->name, PATHINFO_FILENAME);
$orig_name_extension = pathinfo($source->name, PATHINFO_EXTENSION);
@@ -102,6 +91,12 @@ class item_Core {
}
}
}
+
+ // If the target has no cover item, make this it.
+ if ($target->album_cover_item_id == null) {
+ item::make_album_cover($source);
+ }
+
return $message;
}
diff --git a/modules/gallery/helpers/item_rest.php b/modules/gallery/helpers/item_rest.php
index 74fab2e7..692d0895 100644
--- a/modules/gallery/helpers/item_rest.php
+++ b/modules/gallery/helpers/item_rest.php
@@ -112,6 +112,8 @@ class item_rest_Core {
}
break;
+ case "parent":
+ break;
default:
if (property_exists($entity, $key)) {
$item->$key = $entity->$key;
@@ -124,7 +126,7 @@ class item_rest_Core {
$parent = rest::resolve($entity->parent);
item::move($item, $parent);
} else {
- $item::save_with_retries($item);
+ $item->save();
}
}
@@ -155,7 +157,7 @@ class item_rest_Core {
$item->title = isset($entity->title) ? $entity->title : $entity->name;
$item->description = isset($entity->description) ? $entity->description : null;
$item->slug = isset($entity->slug) ? $entity->slug : null;
- $item::save_with_retries($item);
+ $item->save();
break;
case "photo":
@@ -170,7 +172,7 @@ class item_rest_Core {
$item->title = isset($entity->title) ? $entity->title : $entity->name;
$item->description = isset($entity->description) ? $entity->description : null;
$item->slug = isset($entity->slug) ? $entity->slug : null;
- $item::save_with_retries($item);
+ $item->save();
break;
default: