From c014e1b4132d67107ca16909868e352cf3c075b8 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Wed, 8 Sep 2010 19:22:36 -0400 Subject: [PATCH] Need to be in Normal view_mode to accurately get a count of subgalleries. Fixes a bug that would cause subgalleries to become inaccessable in certain conditions --- ansel/lib/Gallery.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ansel/lib/Gallery.php b/ansel/lib/Gallery.php index dc405172d..99225fb92 100644 --- a/ansel/lib/Gallery.php +++ b/ansel/lib/Gallery.php @@ -824,7 +824,14 @@ class Ansel_Gallery extends Horde_Share_Object_Sql_Hierarchical $old = $this->getParent(); $reset_has_subgalleries = false; if (!is_null($old)) { + $vMode = $old->get('view_mode'); + if ($vMode != 'Normal') { + $old->set('view_mode', 'Normal'); + } $cnt = $old->countGalleryChildren(Horde_Perms::READ, true); + if ($vMode != 'Normal') { + $old->set('view_mode', $vMode); + } if ($cnt == 1) { /* Count is 1, and we are about to delete it */ $reset_has_subgalleries = true; -- 2.11.0