Support > cpg1.6 install

Critical error: There was an error while processing a database query

(1/1)

HVW:
I just finished a fresh new install of Coppermine 1.6.26. After a succesfully install I get an error on my Coppermine page.
All settings are still default, nothing changed yet.
I checked update.php, no errors.

These are my site settings:
http://beeldbank.hvwormerveer.nl/
CPG version: 1.6.26
PHP version: 8.2.15

Is there anyone who can help me with this problem?

HVW:
Fixed it by myself!

My conclusion is that the cause of this problem is in the 'sql_mode'. That setting is managed by the hosting partner, so I had to make a workaround.
In the logging of Coppermine I found errors:


--- Quote ---GROUP BY r.aid
ORDER BY NULL' in index.php on line 362 the following error was encountered:
1055 : 'databasename.c.cid' isn't in GROUP BY
--- End quote ---

I edited index.php from this:

--- Quote ---    // album stats for regular albums
    $sql = "SELECT r.aid, c.cid, COUNT(pid) AS pic_count, MAX(pid) AS last_pid, MAX(ctime) AS last_upload, depth AS level, lft
        FROM {$CONFIG['TABLE_CATEGORIES']} AS c
        INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.category = c.cid
        INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.aid = r.aid
        WHERE c.depth >= $CURRENT_CAT_DEPTH + 1
        AND approved = 'YES'
        $forbidden_set
        $lft_rgt
        GROUP BY r.aid
        ORDER BY NULL";
--- End quote ---
To this:

--- Quote ---    // album stats for regular albums
    $sql = "SELECT r.aid, c.cid, COUNT(pid) AS pic_count, MAX(pid) AS last_pid, MAX(ctime) AS last_upload, depth AS level, lft
        FROM {$CONFIG['TABLE_CATEGORIES']} AS c
        INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.category = c.cid
        INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.aid = r.aid
        WHERE c.depth >= $CURRENT_CAT_DEPTH + 1
        AND approved = 'YES'
        $forbidden_set
        $lft_rgt
        GROUP BY r.aid, c.cid, c.depth, c.lft
        ORDER BY NULL";
--- End quote ---

Then the error dissapeared and Coppermine worked like a charm!

Navigation

[0] Message Index

Go to full version