Hi, after I upgraded to 1.4.2.3 (latest attempt was with latest nightly),
instead the gallery's main page I see error message
Fatal error: Call to a member function getNumImages() on a non-object in ..../zp-core/template-functions.php on line 1654
I can see and navigate inside albums by pointing directly to their address. But link to the main page on the top gives weird url - instead the proper gallery url there is additional /page/2/ at the end ( http://my.gallery.url/page/2/).
Downgrading to 1.4.2.2 solved the issue for this time.
It's still problematic. Now after I installed a new version (nightly beta) the first gallery page just returned blank. Also with original "Default" template for 1.4.3!
Again I had to comment out these three lines in template-functions.php
Are you really sure that these lines are necessary? Without them my site works normally, no side effects.
function isImagePage() {
// if (getNumImages()) { //Jaanus commented out
global $_zp_page, $_firstPageImages;
$imagestart = getTotalPages(2); // # of album pages
if (!$_firstPageImages) $imagestart++; // then images start on the last album page.
return $_zp_page >= $imagestart;
//} Jaanus commented out
//return false; //Jaanus commented out
}
OK, but how those lines in template-functions.php should make the newer versions better than 1.4.22 if they "CANNOT" have any impact?
Is it needed for other templates?
Where (in which file) to look for the bug?
May it be because php version is earlier than 5.3 (5.2.17) ?
Etc etc etc
Indeed.... one separate test page shows everything without problems.
So I'm confused. Where could be the "place not setup for it"?
I'm pretty sure it should be somewhere else than theme files - as in my gallery page I got the same error with original "default" template where I hadn't changed anything.
Could some 3rd party plugin generate such error?
Well, your hint helped me and the source of my problem was found on 1st attempt
It was zenFBcommon.php (from the Facebook plugin). I don't know why but error generating code was on line 84:
if (isImagePage()) {
echo '';
}
Perhaps you don't want to know how I solved it
At least temporarily it says now that "if this is not an album page":
if (!isAlbumPage()) {
echo '';
}
Tested. It works. Picture is normally posted to my FB wall.
Good that we figured it out. I think those checks are not correct and meant to check the theme page. That should actuallyl be done by using the $_zp_gallery_pageand checks for album.php or image.php. I will point its developer to this topic so he can fix it.
I'll take a look, but I never ran into any issues like that. What I was aiming for with the isImagePage() was attempting to use the function as the documentation said, which is "Returns true if this page has image thumbs on it"
Up until now this is the first I've heard of that being incorrect or having any errors. Did something change in the usage of this function?
Edit:
As a clarification, I understood the documentation to mean that it will return true if there's an image thumbnail on the page, no matter what page is loaded. For instance, a news page that has an image on that, for a FB link the user would most likely want to use one of the thumbnails from the news page and not their general image.
No, those functions did not change. isImagePage() is meant to check if we have thumbs on a album.php page if the album has images and sub albums. I agree that the doc is not really clear what this is about...
There is no way to check if there is any thumb in general on a page and specifically not on a news or pages page.
Your only chance is to check for the actual theme page.