Member
Member
BertSimons   2010-06-26, 21:45
#1
Hi.. I just made a site on which I inserted an album loop on a zenpage page and the debug log now shows this everytime the page is called

`
{Sat, 26 Jun 2010 21:14:07 GMT}
Backtrace: Bad gallery in instantiation of album merken
Album->Album called
from eval (_zenpage_template_functions.php(16) : eval()'d code [4])
from printCodeblock (_zenpage_template_functions.php [16])
from include (pages.php [69])
from index.php [116]
`
the page itself works great though so I was just thinking on turning the debug log off before handing over the site to the client in case its starts filling up his webspace...

or is it in the code I used?

this is the code I used on the page by inserting it in the codeblock:
(you can see it working here: http://www.denfbv.nl/pages/onze%20merken)

`
"
<?php
$_zp_current_album = new Album($galleryobject,"merken");
$subalbums = $_zp_current_album->getAlbums();
foreach ($subalbums as $subalbum) {
$subalbumobj = new Album($_zp_gallery,$subalbum);
zenpageAlbumImage($subalbumobj->getFolder(),null,130)
} ?>



<?php
$_zp_current_album = new Album($galleryobject,"merken");
$subalbums = $_zp_current_album->getAlbums();
foreach ($subalbums as $subalbum) {
$subalbumobj = new Album($_zp_gallery,$subalbum);?>

[*]<a>getAlbumLink() ;?>"><?php echo $subalbumobj->getTitle();?></a>
<?php } ?>

`
Member
Member
kagutsuchi   2010-06-26, 21:51
#2
Where does `$galleryobject` come from? You might have better luck using the global `$_zp_gallery` instead which stores the main gallery instance. That might be your problem.

Edit: FYI, I edited your post to enclose the code in backticks. It was breaking the page a bit. Wink
Member
Member
sbillard   2010-06-27, 03:26
#3
Interesting that the "page works" as the error (which is deliberately always on) shows that there was an improper album instantiation. This can (and usually) does cause downstream problem as the gallery instance is stored with the album and used numerous places in Zenphoto.

So, presumably $galleryobject has not been setup (correctly.)
Member
Member
BertSimons   2010-06-29, 07:41
#4
fixed

`
<?php $galleryobject = new Gallery();
$_zp_current_album = new Album($galleryobject ,"merken");
$subalbums = $_zp_current_album->getAlbums();
foreach ($subalbums as $subalbum) {
$subalbumobj = new Album($galleryobject,$subalbum);
?>
`
thanks!
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.