From bff26642eb54f33d5e539b5e9f70de058d486e71 Mon Sep 17 00:00:00 2001
From: Georg Ringer <georg.ringer@gmail.com>
Date: Tue, 25 Feb 2020 08:18:56 +0100
Subject: [PATCH] [BUGFIX] Initialize more properties of PageLayoutView
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

With #78450 the StandardContentPreviewRenderer creates an instance of
the  `PageLayoutView` to keep the existing hooks alive.
However 2 more properties need to be filled to improve the
compatibility.

Resolves: #90528
Releases: master

Change-Id: I0c56988bdc9d524f1cfa411ae0c62d00ad1789dd
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63408
Reviewed-by: Claus Due <claus@phpmind.net>
Reviewed-by: Susanne Moog <look@susi.dev>
Reviewed-by: Christian Eßl <indy.essl@gmail.com>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Susanne Moog <look@susi.dev>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
---
 .../backend/Classes/Preview/StandardContentPreviewRenderer.php  | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/typo3/sysext/backend/Classes/Preview/StandardContentPreviewRenderer.php b/typo3/sysext/backend/Classes/Preview/StandardContentPreviewRenderer.php
index d64b26f9794a..b06fab1ae8d3 100644
--- a/typo3/sysext/backend/Classes/Preview/StandardContentPreviewRenderer.php
+++ b/typo3/sysext/backend/Classes/Preview/StandardContentPreviewRenderer.php
@@ -419,6 +419,8 @@ class StandardContentPreviewRenderer implements PreviewRendererInterface, Logger
     protected function createEmulatedPageLayoutViewFromDrawingConfiguration(DrawingConfiguration $drawingConfiguration): PageLayoutView
     {
         $pageLayoutView = GeneralUtility::makeInstance(PageLayoutView::class);
+        $pageLayoutView->id = $drawingConfiguration->getPageId();
+        $pageLayoutView->pageRecord = $drawingConfiguration->getPageRecord();
         $pageLayoutView->option_newWizard = $drawingConfiguration->getShowNewContentWizard();
         $pageLayoutView->defLangBinding = $drawingConfiguration->getDefaultLanguageBinding();
         $pageLayoutView->tt_contentConfig['cols'] = implode(',', $drawingConfiguration->getActiveColumns());
-- 
GitLab