From 9a03bcdf42a3a43e00d5d95372f9e69bc8fe705a Mon Sep 17 00:00:00 2001
From: Nikita Hovratov <nikita.h@live.de>
Date: Mon, 24 Jul 2023 10:41:26 +0200
Subject: [PATCH] [BUGFIX] Check if '_ORIG_uid' really exists in
 ElementInformationController

The computed property '_ORIG_uid' is only set for workspace records,
which are NOT moved (t3ver_state=4). It is better to check directly for
the existence of this key as done in all other occurrences where it is
retrieved. The presence already ensures that we are dealing with an
overlaid workspace record and that there is need to fetch the original
uid.

Resolves: #101426
Releases: main, 12.4, 11.5
Change-Id: I7dd1072736b476015d5d44cb82f5e670fdd484a7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80168
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
---
 .../Controller/ContentElement/ElementInformationController.php  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
index e77e0a5b6eba..0bd958f0478a 100644
--- a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
+++ b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
@@ -177,7 +177,7 @@ class ElementInformationController
             } else {
                 $this->row = BackendUtility::getRecordWSOL($this->table, $this->uid);
                 if ($this->row) {
-                    if (!empty($this->row['t3ver_oid'])) {
+                    if (isset($this->row['_ORIG_uid'])) {
                         // Make $this->uid the uid of the versioned record, while $this->row['uid'] is live record uid
                         $this->uid = (int)$this->row['_ORIG_uid'];
                     }
-- 
GitLab