From: Michael J. Rubinsky Date: Wed, 8 Sep 2010 23:22:36 +0000 (-0400) Subject: Need to be in Normal view_mode to accurately get a count of subgalleries. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c014e1b4132d67107ca16909868e352cf3c075b8;p=horde.git 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 --- 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;