Error in Blitz Diagnostics when using PosgreSQL
borisklotz opened this issue · comments
Bug Report
I just updated the plugin to the latest version. Now I get the following error when I go to Blitz Diagnostics > Tracked Elements and click on one of the listed element types:
SQLSTATE[42803]: Grouping error: 7 ERROR: column "elementexpirydates.expiryDate" must appear in the GROUP BY clause or be used in an aggregate function
LINE 2: FROM (SELECT "elementcaches"."elementId", "elementexpirydate...
^
The SQL being executed was: SELECT COUNT(*)
FROM (SELECT "elementcaches"."elementId", "elementexpirydates"."expiryDate", count(*) AS "count", "title"
FROM "blitz_elementcaches" "elementcaches"
INNER JOIN "blitz_caches" ON "elementcaches"."cacheId" = "blitz_caches"."id"
LEFT JOIN "blitz_elementexpirydates" "elementexpirydates" ON "elementexpirydates"."elementId" = "elementcaches"."elementId"
INNER JOIN "elements" "elements" ON "elements"."id" = "elementcaches"."elementId"
INNER JOIN "content" "content" ON "content"."elementId" = "elementcaches"."elementId"
WHERE ("blitz_caches"."siteId"=1) AND ("content"."siteId"=1) AND ("type"='craft\elements\Entry')
GROUP BY "elementcaches"."elementId", "title"
ORDER BY "count" DESC) "c"
We are using PostgreSQL, so the error might only be related to this particular RDBMS.
Plugin Version
4.11.1
Craft CMS Version
4.7.3
PHP Version
8.1.0