Code to get last uploaded image breaks on subalbums
Blazer0x
Joined: 2005-10-17
Posts: 12 |
Posted: Thu, 2006-02-09 20:20 | |||
I'm using Gallery 1.x, and I'm using the attached "lastimage.php" script, which pulls and displays the LAST UPLOADED IMAGE. I use it for "moblogging", and it displays the last picture I sent from my cellphone in the sidebar of my site. This script works great, except if I create any galleries that have a nested (sub-gallery) gallery, it breaks with the error "Call to a member function on a non-object". If I add some debug print statements, I can see that it breaks upon checking the gallery that has a sub gallery. If anyone has any idea how to correct the problem (Other than using Gallery2 instead), it would be much appreciated.
|
||||
Posts: 12
I should probably mention the exact error that gets generated:
PHP Fatal error: Call to a member function on a non-object in /www/apps/gallery/classes/AlbumItem.php on line 58
Line 58 of AlbumItem.php is part of the setUploadDate function, and is shown as the last line of the code snippet below
Posts: 2258
See if you can narrow it down to if $gallery is null or $gallery->album is null