ZenphotoCMS Forum
Broken dynamic album navigation? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Broken dynamic album navigation? (/thread-13620.html)



Broken dynamic album navigation? - mkanoute - 2021-07-28

Hello,

Version 1.59: I was investigating a problem where the navigation within dynamic albums no longer works (Image::getNextImage()/Image::getPrexImage() does no return the next/previous photo in the dynamic album and even returns the same photo). I came across commit 5021ec8b071239c73ce7c50faba4f1ec18034016 where it seems that there is a left ofver of debugging code at line 1629 of zp-core/class-image.php; the variable $use_realalbum is forced to true, which defeats the purpose of passing it as an argument 2 lines above:

- function getIndex() {
+ function getIndex($use_realalbum = false) {
global $_zp_current_search, $_zp_current_album;
+ $use_realalbum = true;
if ($this->index == NULL) {

Removing this line of code fixes the issue.

Could someone confirm the issue and the fix?

Regards,




Broken dynamic album navigation? - acrylian - 2021-07-28

This is actually from a fix added to 1.5.9 on specific user report:
https://github.com/zenphoto/zenphoto/commit/5021ec8b071239c73ce7c50faba4f1ec18034016

It was tested back then by even the reporter to fix the issue… The line $use_realalbum = true; iis ineed total nonsense as it overrides the parameter… I can only assume it is orgotten test code…




Broken dynamic album navigation? - acrylian - 2021-07-28

THis is actually already fixed in 1.6a but I don't recommend to use that on a production site because of changes in various places. So just remove the line.




Broken dynamic album navigation? - mkanoute - 2021-07-28

I did, thanks.