aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Martin <caedes@sindominio.net>2012-10-23 02:43:14 +0000
committerroot <root@migration.vz.lan>2012-10-23 02:43:26 +0000
commit2ca39d79862f86065cd2675eab3b795cc8e02411 (patch)
treeea4fbcee9dc2297f5a32126a9b370413eb2d634b
parent389a4a5705e7587141a34fb3eb3c5bc355d7846e (diff)
downloadelgg-2ca39d79862f86065cd2675eab3b795cc8e02411.tar.gz
elgg-2ca39d79862f86065cd2675eab3b795cc8e02411.tar.bz2
protect from albums with no container.
-rw-r--r--views/default/object/album/gallery.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/views/default/object/album/gallery.php b/views/default/object/album/gallery.php
index 53194b53c..d6fb598e4 100644
--- a/views/default/object/album/gallery.php
+++ b/views/default/object/album/gallery.php
@@ -10,6 +10,7 @@
$album = elgg_extract('entity', $vars);
+
$album_cover = elgg_view_entity_icon($album, 'small');
$header = elgg_view('output/url', array(
@@ -19,11 +20,14 @@ $header = elgg_view('output/url', array(
'class' => 'tidypics-heading',
));
-$footer = elgg_view('output/url', array(
- 'text' => $album->getContainerEntity()->name,
- 'href' => $album->getContainerEntity()->getURL(),
- 'is_trusted' => true,
-));
+$footer = "";
+if ($album->getContainerEntity()) {
+ $footer .= elgg_view('output/url', array(
+ 'text' => $album->getContainerEntity()->name,
+ 'href' => $album->getContainerEntity()->getURL(),
+ 'is_trusted' => true,
+ ));
+}
$footer .= '<div class="elgg-subtext">' . elgg_echo('album:num', array($album->getSize())) . '</div>';
$params = array(