Critical error when I active "Visitors can upload files *" Critical error when I active "Visitors can upload files *"
 

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

Critical error when I active "Visitors can upload files *"

Started by marraqy, January 04, 2017, 04:09:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

marraqy

Hi, I'll try to describe my error:

1-) with admin account I create a album, then I active the option in properties "I Visitors can upload files *"

2-) with a simple registered user, i try upload file, then error happen, I receive this message:

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

with debug mode:
While executing query 'SELECT DISTINCT c.cid, c.rgt, c.name FROM cpg15x_albums AS a RIGHT JOIN cpg15x_categories AS c ON a.category = c.cid WHERE c.cid = 1 OR a.owner = 2 OR uploads = "YES" ORDER BY lft' in include/functions.inc.php on line 6034

mySQL error: Expression #1 of ORDER BY clause is not in SELECT list, references column 'dbfotos.c.lft' which is not in SELECT list; this is incompatible with DISTINCT

File: /var/www/html/fotos/include/functions.inc.php - Line: 272



I try reinstall with another version, like 1.6, however the error stay. Any help to solution this error?

marraqy

Hi, after some research i found this solution:

Edit this file (/etc/mysql/my.cnf), and add this query:

[mysqld]
sql-mode=""

Then error is fixed.

Thanks,

ΑndrĂ©

Quote from: marraqy on January 05, 2017, 12:26:48 AM
Edit this file (/etc/mysql/my.cnf), and add this query:

[mysqld]
sql-mode=""

That solution isn't available to everybody, so I tried to replicate the issue to create a fix. Unfortunately I wasn't able to replicate it. It should be fixed by adding c.lft to the SELECT list, but I don't know if it creates any side effects.