Skip to content

Commit

Permalink
[BUGFIX] Workspace relations in ElementInformationController
Browse files Browse the repository at this point in the history
When relations are added in a workspace, the 'info' modal
of the parent record does not reflect those. The patch changes
the reference resolving to work with the overlay record uid if
given. This fixes reference record display for inline records
including file references.
There are further issues with the rendered record, those
however are resolved by other core methods and can be
fixed with other patches.

Resolves: #45148
Releases: master, 10.4
Change-Id: I7d32a1218eaa2ed47c6cba27e0e52b54e70ae68f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65474
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
lolli42 authored and andreaskienast committed Aug 28, 2020
1 parent 0d54f0d commit ac7eed7
Showing 1 changed file with 5 additions and 8 deletions.
Expand Up @@ -124,7 +124,6 @@ class ElementInformationController
public function __construct()
{
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$GLOBALS['SOBE'] = $this;
}

/**
Expand Down Expand Up @@ -182,13 +181,11 @@ protected function initDatabaseRecord(): void
} else {
$this->row = BackendUtility::getRecordWSOL($this->table, $this->uid);
if ($this->row) {
// Find the correct "pid" when a versionized record is given, otherwise "pid = -1" always fails
if (!empty($this->row['t3ver_oid'])) {
$t3OrigRow = BackendUtility::getRecord($this->table, (int)$this->row['t3ver_oid']);
$this->pageInfo = BackendUtility::readPageAccess((int)$t3OrigRow['pid'], $this->permsClause);
} else {
$this->pageInfo = BackendUtility::readPageAccess($this->row['pid'], $this->permsClause);
// Make $this->uid the uid of the versioned record, while $this->row['uid'] is live record uid
$this->uid = (int)$this->row['_ORIG_uid'];
}
$this->pageInfo = BackendUtility::readPageAccess((int)$this->row['pid'], $this->permsClause);
$this->access = is_array($this->pageInfo);
}
}
Expand Down Expand Up @@ -549,8 +546,8 @@ protected function getReferences(ServerRequestInterface $request): array
$references = [];
switch ($this->type) {
case 'db': {
$references['refLines'] = $this->makeRef($this->table, $this->row['uid'], $request);
$references['refFromLines'] = $this->makeRefFrom($this->table, $this->row['uid'], $request);
$references['refLines'] = $this->makeRef($this->table, $this->uid, $request);
$references['refFromLines'] = $this->makeRefFrom($this->table, $this->uid, $request);
break;
}

Expand Down

0 comments on commit ac7eed7

Please sign in to comment.