[BUGFIX] Explicit cast to string for VersionState object 17/52917/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 22 May 2017 21:12:31 +0000 (23:12 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 22 May 2017 22:09:38 +0000 (00:09 +0200)
Some DB drivers are picky on their arguments not being
objects. Add an explicit cast to string for a VersionState
object just before it's fed to a query as argument.

Change-Id: I81c8f9dded7068ad7bf817e034aa67a29f28290c
Resolves: #81309
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/52917
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/frontend/Classes/Page/PageRepository.php

index 2e78b2d..3684fc5 100644 (file)
@@ -1696,7 +1696,7 @@ class PageRepository
                         $queryBuilder->expr()->eq(
                             't3ver_state',
                             $queryBuilder->createNamedParameter(
-                                new VersionState(VersionState::MOVE_PLACEHOLDER),
+                                (string)VersionState::cast(VersionState::MOVE_PLACEHOLDER),
                                 \PDO::PARAM_INT
                             )
                         ),