[BUGFIX] Cast return value of getLivePageUid to int 52/58152/2
authorSusanne Moog <susanne.moog@typo3.org>
Mon, 3 Sep 2018 19:02:47 +0000 (21:02 +0200)
committerBenni Mack <benni@typo3.org>
Mon, 3 Sep 2018 19:57:08 +0000 (21:57 +0200)
On database systems like sqlite fields like uid or
t3ver_oid are returned as string and need to be casted.

This casting has been added in PreviewUriBuilder
->getLivePageUid.

Resolves: #86119
Releases: master
Change-Id: I7fec760b0aee749e72a640488e1021681471c9ec
Reviewed-on: https://review.typo3.org/58152
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Richard Haeser <richard@maxserv.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
typo3/sysext/workspaces/Classes/Preview/PreviewUriBuilder.php

index dd67341..3be9cae 100644 (file)
@@ -238,7 +238,7 @@ class PreviewUriBuilder
         if (!isset($this->pageCache[$uid])) {
             $pageRecord = BackendUtility::getRecord('pages', $uid);
             if (is_array($pageRecord)) {
-                $this->pageCache[$uid] = $pageRecord['t3ver_oid'] ? $pageRecord['t3ver_oid'] : $uid;
+                $this->pageCache[$uid] = $pageRecord['t3ver_oid'] ? (int)$pageRecord['t3ver_oid'] : $uid;
             } else {
                 throw new \InvalidArgumentException('uid is supposed to point to an existing page - given value was: ' . $uid, 1290628113);
             }