Hey Folks,
I am using Coppermine 1.4.25 in combination with the Light Box 1.2 Plugin. The plugin is very very nice, thanks for the great work! Everything works fine, except when clicking on random thumbnails. In this case I only get the message: "There was an error while processing a database query". The same problem was already reported for an older version of Coppermine in the following thread:
http://forum.coppermine-gallery.net/index.php/topic,52160.0.html. But the solution posted in the mentioned thread doesn't fix the problem. The solution mentioned in the thread refers to an error in Coppermine, but imho it is caused by the plugin.
When the plugin tries to build its internal picture list, it uses the result of $_GET['album'] as album identifier. This is fine in most cases, but when clicking on one of the random thumbnails, "random" is passed as album identifier. Because the plugin doesn't change the album identifier to the random pictures actual album ID, it tries to build its internal picture list based on the random album, instead of the actual album related to the picture. This leads to an error when the plugin calls the get_pic_data function, as the parameters don't match for the random album.
In order to fix the bug, just one line in the codebase.php of the plugin file has to be changed.
Line 155:
Original:
$aid = empty($_GET['album']) ? $picId['aid'] : $_GET['album'];
Corrected:
$aid = (empty($_GET['album']) || ($_GET['album'] == 'random')) ? $picId['aid'] : $_GET['album'];
Thanks for your attention. If you want to do more investigations let me know, I will set an testgallery so you can check the scenario.
Take Care,
Philipp