mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-06-21 03:59:35 -04:00
The monitors index unconditionally LEFT JOINed Groups_Monitors and collapsed the duplicate rows (monitors in multiple groups) with GROUP BY `Monitor`.`Id`. That GROUP BY fails under ONLY_FULL_GROUP_BY on engines without functional dependency detection (MariaDB), raising 1055 'Monitor.Name isn't in GROUP BY', so /api/monitors.json returned a 500 while /api/monitors/<id>.json worked. Only join Groups_Monitors when the request filters by group (matching the existing EventsController pattern and the original commented-out intent), drop the GROUP BY, and dedupe by monitor Id in the existing result loop to cover multi-value GroupId filters. Portable across MySQL and MariaDB. refs #3633