Dolphiq / craft3-plugin-sitemap

A craft 3 plugin that provides an easy way to enable and manage an XML sitemap for search engines like Google
MIT License
28 stars 18 forks source link

Postgres compatibility? #21

Closed askogrand closed 4 years ago

askogrand commented 6 years ago

When trying to access the plugins settings via the settings page, I get the following error:


LINE 4: ...tionId" = "sections"."id" AND "sections_sites"."hasUrls" = 1
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
The SQL being executed was: SELECT "sections"."id", "sections"."structureId", "sections"."name", "sections"."handle", "sections"."type", count(DISTINCT entries.id) entryCount, count(DISTINCT elements.id) elementCount, "sitemap_entries"."id" AS "sitemapEntryId", "sitemap_entries"."changefreq" AS "changefreq", "sitemap_entries"."priority" AS "priority"
FROM "sections" "sections"
LEFT JOIN "structures" "structures" ON "structures"."id" = "sections"."structureId"
INNER JOIN "sections_sites" "sections_sites" ON "sections_sites"."sectionId" = "sections"."id" AND "sections_sites"."hasUrls" = 1
LEFT JOIN "entries" "entries" ON "sections"."id" = "entries"."sectionId"
LEFT JOIN "elements" "elements" ON "entries"."id" = "elements"."id" AND "elements"."enabled" = 1
LEFT JOIN "dolphiq_sitemap_entries" "sitemap_entries" ON "sections"."id" = "sitemap_entries"."linkId" AND "sitemap_entries"."type" = "section"
GROUP BY "sections"."id"
ORDER BY "type"
Error Info: Array
(
    [0] => 42883
    [1] => 7
    [2] => ERROR:  operator does not exist: boolean = integer
LINE 4: ...tionId" = "sections"."id" AND "sections_sites"."hasUrls" = 1
                                                                    ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.```

I believe that 1 for `true` would work in mysql, but it breaks in postgres:9.6.5
johanzandstra commented 4 years ago

Fixed in next release

maxstrebel commented 4 years ago

Do you know when the release might be?