summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/albums.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/controllers/albums.php')
-rw-r--r--modules/gallery/controllers/albums.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index f3f5dee3..b0887195 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -68,7 +68,7 @@ class Albums_Controller extends Items_Controller {
$template->set_global("item", $album);
$template->set_global("children", $album->viewable()->children($page_size, $offset));
$template->set_global("children_count", $children_count);
- $template->set_global("parents", $album->parents());
+ $template->set_global("parents", $album->parents()->as_array()); // view calls empty() on this
$template->content = new View("album.html");
// We can't use math in ORM or the query builder, so do this by hand. It's important
@@ -132,7 +132,9 @@ class Albums_Controller extends Items_Controller {
$album->description = $form->edit_item->description->value;
$album->sort_column = $form->edit_item->sort_order->column->value;
$album->sort_order = $form->edit_item->sort_order->direction->value;
- $album->name = $form->edit_item->inputs["name"]->value;
+ if (array_key_exists("name", $form->edit_item->inputs)) {
+ $album->name = $form->edit_item->inputs["name"]->value;
+ }
$album->slug = $form->edit_item->slug->value;
$album->validate();
} catch (ORM_Validation_Exception $e) {