diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php index 5676c1470faf10cba56b4203143e4a86e64eae59..f8d7e1f908a91866a3ac8f9e085019c93893ca61 100644 --- a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php +++ b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php @@ -20,7 +20,6 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Backend\Attribute\Controller; -use TYPO3\CMS\Backend\Backend\Avatar\Avatar; use TYPO3\CMS\Backend\Form\FormDataCompiler; use TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord; use TYPO3\CMS\Backend\History\RecordHistory; @@ -397,16 +396,13 @@ class ElementInformationController } // Show the user who created the record $recordHistory = GeneralUtility::makeInstance(RecordHistory::class); - $ownerInformation = $recordHistory->getCreationInformationForRecord($this->type, $this->row); - $ownerUid = (int)(is_array($ownerInformation) && $ownerInformation['actiontype'] === 'BE' ? $ownerInformation['userid'] : 0); + $ownerInformation = $recordHistory->getCreationInformationForRecord($this->table, $this->row); + $ownerUid = (int)(is_array($ownerInformation) && $ownerInformation['usertype'] === 'BE' ? $ownerInformation['userid'] : 0); if ($ownerUid) { $creatorRecord = BackendUtility::getRecord('be_users', $ownerUid); if ($creatorRecord) { - $avatar = GeneralUtility::makeInstance(Avatar::class); - $creatorRecord['icon'] = $avatar->render($creatorRecord); - $rowValue = $creatorRecord; $keyLabelPair['creatorRecord'] = [ - 'value' => $rowValue, + 'value' => $creatorRecord, 'fieldLabel' => rtrim(htmlspecialchars($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.creationUserId')), ':'), ]; } diff --git a/typo3/sysext/backend/Resources/Private/Templates/ContentElement/ElementInformation.html b/typo3/sysext/backend/Resources/Private/Templates/ContentElement/ElementInformation.html index 2132d812993e803e4d19b76372dfdb35f8cbdfbc..ca7e8246cea0f8e2894dd85a80ff4d3347bea226 100644 --- a/typo3/sysext/backend/Resources/Private/Templates/ContentElement/ElementInformation.html +++ b/typo3/sysext/backend/Resources/Private/Templates/ContentElement/ElementInformation.html @@ -1,5 +1,6 @@ <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" + xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers" xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers" data-namespace-typo3-fluid="true" > @@ -55,15 +56,20 @@ </f:for> </div> <f:if condition="{extraFields.creatorRecord}"> - <div class="row mt-2"> + <div class="row mt-3"> + <div class="col-md-12"> + <strong>{extraFields.creatorRecord.fieldLabel}</strong> + </div> <div class="col-md-12"> <div class="media"> <div class="media-left"> - {extraFields.creatorRecord.value.icon -> f:format.raw()} + <be:avatar backendUser="{extraFields.creatorRecord.value.uid}" showIcon="true" /> </div> <div class="media-body"> - <strong>{extraFields.creatorRecord.value.username}</strong><br> - {extraFields.creatorRecord.value.realName} + <f:if condition="{extraFields.creatorRecord.value.realName}"> + <f:then>{extraFields.creatorRecord.value.realName}<br>({extraFields.creatorRecord.value.username})</f:then> + <f:else>{extraFields.creatorRecord.value.username}</f:else> + </f:if> </div> </div> </div>