diff --git a/Classes/Util.php b/Classes/Util.php index fd1d5966aa..e0de2d5989 100644 --- a/Classes/Util.php +++ b/Classes/Util.php @@ -114,9 +114,14 @@ public static function isDraftRecord(string $table, int $uid): bool $isWorkspaceRecord = false; if ((ExtensionManagementUtility::isLoaded('workspaces')) && (BackendUtility::isTableWorkspaceEnabled($table))) { - $record = BackendUtility::getRecord($table, $uid, 'pid, t3ver_state'); - - if ($record !== null && ($record['pid'] == '-1' || $record['t3ver_state'] > 0)) { + $record = BackendUtility::getRecord($table, $uid, 'pid, t3ver_state, t3ver_oid'); + + // \TYPO3\CMS\Core\Versioning\VersionState for an explanation of the t3ver_state field + // if it is >0, it is a draft record or + // if it is "0" (DEFAULT_STATE), could also be draft if t3ver_oid points to any uid (modified record) + if ($record !== null && + ($record['pid'] == '-1' || $record['t3ver_state'] > 0 || (int)$record['t3ver_oid'] > 0) + ) { $isWorkspaceRecord = true; } }