From 83315e134e04690fdff85d04c29d969cf2ccd3a1 Mon Sep 17 00:00:00 2001 From: Kamil Kuzminski Date: Tue, 10 Jan 2023 13:11:13 +0100 Subject: [PATCH] Fix the SQL syntax error when saving a page record (#219) * Fix the SQL syntax error when saving a page record (#217) * Update src/EventListener/DataContainer/PageOperationListener.php Co-authored-by: Andreas Schempp * Update src/EventListener/DataContainer/PageOperationListener.php Co-authored-by: Andreas Schempp * CS Co-authored-by: Andreas Schempp --- .../DataContainer/PageOperationListener.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/EventListener/DataContainer/PageOperationListener.php b/src/EventListener/DataContainer/PageOperationListener.php index 387e5ba..2fcfddb 100644 --- a/src/EventListener/DataContainer/PageOperationListener.php +++ b/src/EventListener/DataContainer/PageOperationListener.php @@ -130,11 +130,10 @@ private function resetPageAndChildren(int $pageId): void $resetIds = Database::getInstance()->getChildRecords($pageId, 'tl_page'); $resetIds[] = $pageId; - $this->connection->update( - 'tl_page', - ['languageMain' => 0], - ['id' => $resetIds], - ['id' => Connection::PARAM_INT_ARRAY] + $this->connection->executeStatement( + 'UPDATE tl_page SET languageMain = 0 WHERE id IN (?)', + [$resetIds], + [Connection::PARAM_INT_ARRAY] ); } }