CMS MADE SIMPLE FORGE

Khronos

 

[#12650] Event list query error

avatar
Created By: Anders Rehnvall (hansson)
Date Submitted: Sun Oct 01 03:15:54 -0400 2023

Assigned To: Fernando Morgado (JoMorg)
Version: 1.0.0
CMSMS Version: 2.2.18
Severity: Minor
Resolution: None
State: Open
Summary:
Event list query error
Detailed Description:
When using one of the list views (display=mont/yearlist/upcominglist etc), the
SQL builds out to "SELECT DISTINCT ..." with a ORDER BY E.event_date_start.
This kicks out the following error in MySQL 5.7.32:
"ERROR 3065 (HY000): Expression #1 of ORDER BY clause is not in SELECT list,
references column 'cms.E.event_date_start' which is not in SELECT list; this is
incompatible with DISTINCT"

I patched it by adding E.event_date_start in class.utils.php, get_query:
$sql = "SELECT DISTINCT E.event_id,E.event_date_start FROM $events_table_name
E\n";

Not sure if this is the right fix, but it seems to work.. 

Thanks for a great module!


History