Issue Bug Closed

#102397PostgreSQL: Argument of AND must be type boolean, not type integer

cosmoblonde GmbH 11/17/23, 18:16 updated 12/04/23, 12:12

Description

When translating a page in TYPO3 v12 using a Postgres Database the following error appears:

An exception occurred while executing a query: SQLSTATE42804: Datatype mismatch: 7 ERROR: argument of AND must be type boolean, not type integer LINE 1: …RE (“pid” = $1) AND (“sys_language_uid” = 0) AND (1 AND ((“…

The full query is this:
SELECT “uid” FROM “pages” WHERE (“pid” = ?) AND (“sys_language_uid” = 0) AND
(1 AND ((“pages”.“hidden” = 0) AND (“pages”.“starttime” <= 1700242560) AND
(((“pages”.“endtime” = 0) OR (“pages”.“endtime” > 1700242560))))) AND (“pag
es”.“deleted” = 0) ORDER BY “uid” ASC

This is due to the fact that Postgres can’t handle 1 and 0 as boolean and fails.
The translated page record is still created as this query is not responsible for the new record but executed after the record was created.

A similar error was reported here (https://forge.typo3.org/issues/75912) a long time ago but was related to content elements.

Can you please take a look at this?

Thank you!

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.