summaryrefslogtreecommitdiff
path: root/core/helpers/album.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/helpers/album.php')
-rw-r--r--core/helpers/album.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/helpers/album.php b/core/helpers/album.php
index 3e3b6054..83bbfbab 100644
--- a/core/helpers/album.php
+++ b/core/helpers/album.php
@@ -47,7 +47,12 @@ class album_Core {
$album->name = "{$name}-" . rand();
}
- $album = $album->add_to_parent($parent_id);
+ $parent = ORM::factory("item", $parent_id);
+ if (!$parent->loaded) {
+ throw new Exception("@todo INVALID_PARENT_ID");
+ }
+
+ $album = $album->add_to_parent($parent);
mkdir($album->file_path());
$thumbnail_dir = dirname($album->thumbnail_path());
if (!file_exists($thumbnail_dir)) {