6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
8/15/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#3806] Few bugs in lib/Block/gallery.php
*
Your Email Address
*
Spam protection
Enter the letters below:
__ . ..__.. ,. . / `|__|[__] \./ \ / \__.| || | | \/
Comment
> 1. $registry is needed in _content() function, but lib/base.php is > not included. This resuls in a fatal PHP error when displaying a > gallery that contains no photos in this block. > > 2. themes/graphics/error.png no longer exists, but is used in > _content(). Should be updated to use themes/graphics/thumb-error.png. > > 3. _getGallery() uses incorrect class name, Ansel_Gallery in is_a() > call to determine if a gallery has already been selected. Should be > is_a($this->_gallery, 'DataTreeObject_Gallery'). > > > > > > Here's my patch: > > > > --- gallery.php (revision 35) > > +++ gallery.php (working copy) > > @@ -60,6 +60,9 @@ > > > > function _content() > > { > > + @define('ANSEL_BASE', dirname(__FILE__) . '/../..'); > > + require ANSEL_BASE . '/lib/base.php'; > > + > > $gallery =& $this->_getGallery(); > > if (is_a($gallery, 'PEAR_Error')) { > > return $gallery; > > @@ -73,7 +76,7 @@ > > if ($gallery->getDefaultImage()) { > > $html .= > Horde::img(Ansel::getImageUrl($gallery->getDefaultImage(), 'thumb', > true), '', '', '') . '</a>'; > > } else { > > - $html .= Horde::img($registry->getImageDir() . > '/error.png', '', '', '') . '</a>'; > > + $html .= Horde::img($registry->getImageDir() . > '/thumb-error.png', '', '', '') . '</a>'; > > } > > > > return $html . '</a></div>'; > > @@ -85,7 +88,7 @@ > > require ANSEL_BASE . '/lib/base.php'; > > > > // Make sure we haven't already selected a gallery. > > - if (is_a($this->_gallery, 'Ansel_Gallery')) { > > + if (is_a($this->_gallery, 'DataTreeObject_Gallery')) { > > return $this->_gallery; > > } > >
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers