Matthew Thode

Results 79 comments of Matthew Thode

looks like the same happened with 1.14.0

I've had this issue with swaylock only (I don't have any effects or fancy module installed).

``` { "success": false, "data": { "code": 500, "name": "SQLSTATE[42000]: Syntax error or access violation: 1055 'zm.Monitor.Name' isn't in GROUP BY", "message": "SQLSTATE[42000]: Syntax error or access violation: 1055 'zm.Monitor.Name'...

this query works, but everything selected seems to need to be in the group by ``` `SELECT `Monitor`.`Id`, `Monitor`.`Name`, `Monitor`.`Notes`, `Monitor`.`ServerId`, `Monitor`.`StorageId`, `Monitor`.`ManufacturerId`, `Monitor`.`ModelId`, `Monitor`.`Type`, `Monitor`.`Function`, `Monitor`.`Capturing`, `Monitor`.`Analysing`, `Monitor`.`AnalysisSource`, `Monitor`.`AnalysisImage`,...

running `SET SESSION sql_mode='';` before the query allows it to run as well. Looks like requiring everything selected to be in the group_by is part of the sql standard and...

default (global) sql mode is `ONLY_FULL_GROUP_BY,NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION`

looks like this is where the query is run, I think (I haven't done PHP in a LONG time). https://github.com/ZoneMinder/zoneminder/blob/master/web/api/app/Controller/MonitorsController.php#L53-L66

not sure if the group by is needed, but I removed the group by with ``` sed -i "/'\`Monitor\`.\`Id\`'/d" /var/www/html/api/app/Controller/MonitorsController.php ``` and the api works well enough for home-assistant to...