[Fixed]: Bug in functions.ini.php in combination with lightbox?? [Fixed]: Bug in functions.ini.php in combination with lightbox??
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Fixed]: Bug in functions.ini.php in combination with lightbox??

Started by Ivo007, April 23, 2008, 02:47:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ivo007

Hi all

I have implemented lightbox in my coppermine 1.4.14 gallery. It worked all fine except by clicking on the random thumbnails I would get the error "There was an error while processing a database query".
The debug mode said:
While executing query "SELECT * FROM cpg14x_pictures WHERE approved = 'YES'  ORDER BY RAND() LIMIT -1" on 0

mySQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1

File: /home/www/web170/html/domainxyz/gallery/include/functions.inc.php - Line: 249


That happens only when I click on the random images. The rest worked fine. I had to correct 2 lines in functions.ini.php (see below). After that i had no problems any more, all fine.

here the lines:
line 1229:
original: $query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() LIMIT $limit2";

corrected:  $query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() $limit";

line 1505:
original:  search_phrase = '$query_terms',
corrected: search_phrase = '$query_term',

I upgraded my gallery from 1.4.14 to 1.4.18. It went all smooth. Although, I had to do the same corrections in functions.ini.php for the same lines. Don't know if thats a bug from an older version of coppermine,  but might be double checked.
If you want to do more investigations let me know, I will set an testgallery so you can test the scenario.

Cheers
Ivo

Paver

Both bugs have been fixed and committed to the Subversion repositories (stable and devel).

Will be in 1.4.21 and higher.