diff options
Diffstat (limited to 'modules/gallery/helpers/album.php')
-rw-r--r-- | modules/gallery/helpers/album.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/gallery/helpers/album.php b/modules/gallery/helpers/album.php index cc631be4..feaf74cc 100644 --- a/modules/gallery/helpers/album.php +++ b/modules/gallery/helpers/album.php @@ -34,7 +34,7 @@ class album_Core { * @return Item_Model */ static function create($parent, $name, $title, $description=null, $owner_id=null, $slug=null) { - if (!$parent->loaded || !$parent->is_album()) { + if (!$parent->loaded() || !$parent->is_album()) { throw new Exception("@todo INVALID_PARENT"); } @@ -68,11 +68,11 @@ class album_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", $album->name) - ->orwhere("slug", $album->slug) - ->close_paren() + ->where("parent_id", "=", $parent->id) + ->and_open() + ->where("name", "=", $album->name) + ->or_where("slug", "=", $album->slug) + ->close() ->find()->id) { $rand = rand(); $album->name = "{$name}-$rand"; @@ -115,6 +115,7 @@ class album_Core { static function get_edit_form($parent) { $form = new Forge("albums/update/{$parent->id}", "", "post", array("id" => "g-edit-album-form")); + $form->hidden("from_id"); $group = $form->group("edit_item")->label(t("Edit Album")); $group->input("title")->label(t("Title"))->value($parent->title); |