Zenphoto 1.2.2 [3131] - default theme.
I am using getRandomImagesAlbum() on my index.php.
When I set the function to choose from a dynamic album I get this error:
Fatal error: Call to a member function getSearchEngine() on a non-object in path-to-zenphoto\zenphoto\zp-core\template-functions.php on line 2920
It works fine with all the other "normal" albums.
Any ideas ?
It seems to be working in the Efferevescence+ theme. Maybe we need more information. The error you are getting indicates that the "album" was not an object. So how was getRandomImagesAlbum() called? Any parameters? If no parameters were passed it is an indication that $_zp_current_album is not setup. If you did pass a parameter, then there is something wrong with that parameter.
Ok, Got it. The code in getRandomImagesAlbum that reads:
if ($album->isDynamic()) { $search = $_zp_current_album->getSearchEngine(); $images = $search->getImages(0);
needs instead to say
if ($album->isDynamic()) { $search = $album->getSearchEngine(); $images = $search->getImages(0);