Gray Dragon Error when viewing photo from tag results

TMacSC

Joined: 2014-03-19
Posts: 10
Posted: Fri, 2014-03-21 19:13

I am getting an error when I view an image from the page that appears when a tag is clicked. The admin error reports:
Platform information
Host name: timserve.local
Operating system: Darwin 13.1.0
Apache: Apache/2.2.26 (Unix) DAV/2 PHP/5.4.24 mod_ssl/2.2.26 OpenSSL/0.9.8y
PHP: 5.4.24
MySQL: 5.6.16
Server load: 1.11767578125 0.93798828125 0.86376953125
Graphics toolkit: imagemagick
Gallery stats
Version: 3.0.9 (Chartres)
Albums: 91
Photos: 2627
Kohana_PHP_Exception [ Fatal Error ]:
Call to a member function url() on a non-object
DOCROOT/themes/greydragon/views/paginator.html.php[ 76 ]

71
72 $total_pages = $total;
73 if (isset($parent)):
74 $siblings = $parent->children();
75 for ($i = 1; $i <= $total; $i++):
76 $_pagelist[$i] = $siblings[$i-1]->url();
77 endfor;
78 endif;
79 break;
80 default:
81 $current_page = 1;
{PHP internal call} » Kohana_PHP_Exception_Core::shutdown_handler( arguments )

SYSPATH/core/Event.php[ 208 ] » call_user_func_array( arguments )

SYSPATH/core/Kohana.php[ 553 ] » Event_Core::run( arguments )

{PHP internal call} » Kohana_Core::shutdown()

You should be able to reproduce this by browsing to http://new.mclenegan.com/photos and clicking the Matthew McLenegan tag on the right. Many of the photos trigger this error (some times it corrects itself by loading the photo page in a different browser??). I will continue trying to debug, but any guidance would be appreciated. The error does not seem to occur when viewing the photo directly from its album page.

I also noticed that the navigation links are not appearing. Is there some error in the way that the photo is called up when it comes from a tag results page? Maybe there is a dependency on a referrer?

The error is able to be suppressed by adding an is_object check around the offending line, but then there still are no pagination links (of course).

 
Serge D
Serge D's picture

Joined: 2009-06-11
Posts: 2466
Posted: Fri, 2014-03-21 20:13

Please try using latest G3 with GD 4.0.1 released today

 
TMacSC

Joined: 2014-03-19
Posts: 10
Posted: Fri, 2014-03-21 21:10

Looks like that should fix my issue, great! However, when I activate the new version, I get an empty page, and Apache is showing a seg fault. What can I do to help track down the issue?

 
TMacSC

Joined: 2014-03-19
Posts: 10
Posted: Fri, 2014-03-21 23:45

I found the bug. It’s on line 421 of MY_theme_view.php.

You have
if (!empty(trim($title))):

I corrected it to:
if (!(trim($title) == false)):

The original is only valid in PHP 5.5+ (see note at http://us3.php.net/empty). This code should be accomplishing the same thing, but is supported by PHP versions prior to PHP 5.5, such as my 5.4 installation.