diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-07 08:46:44 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-07 08:46:44 +0000 |
commit | bf7ab8904aa9ccbb201b1ef9634a8b13834e5f6d (patch) | |
tree | d62ae674a2a81696420ef293b0a033605c84da02 /core/helpers/album.php | |
parent | e40b54a4689f1565e0f76c536d0d4b05b23afc1e (diff) |
Change ORM_MPTT::add_to_parent() to take an ORM instead of an id so
that it's consistent with ORM_MPTT::move_to()
Diffstat (limited to 'core/helpers/album.php')
-rw-r--r-- | core/helpers/album.php | 7 |
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)) { |