| Summary | Few bugs in lib/Block/gallery.php |
| Queue | Ansel |
| Type | Bug |
| State | Resolved |
| Priority | 2. Medium |
| Owners | |
| Requester | dorm (at) dorm (dot) org |
| Created | 04/21/2006 (7182 days ago) |
| Due | |
| Updated | 04/23/2006 (7180 days ago) |
| Assigned | |
| Resolved | 04/23/2006 (7180 days ago) |
| Github Issue Link | |
| Github Pull Request | |
| Milestone | |
| Patch | No |
State ⇒ Resolved
fixed the other problems as well. Thanks!
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Few bugs in lib/Block/gallery.php
Queue ⇒ Ansel
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;
}