Skip to content
Snippets Groups Projects
Commit a8fa5789 authored by Marc Bastian Heinrichs's avatar Marc Bastian Heinrichs Committed by Anja Leichsenring
Browse files

[BUGFIX] Show data of valid columns in element info

The element information show rows for the data from
the special fields crdate, cruser_id and tstamp also if they
are not defined in TCA. They are also hardcoded and
doesn't rely on the settings in TCA ctrl.

Resolves: #55699
Releases: master, 6.2
Change-Id: I7c9a387c75d367618117ffcb6f04592ee519cecc
Reviewed-on: http://review.typo3.org/27360


Reviewed-by: default avatarFrederic Gaus <frederic.gaus@flagbit.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent 5e963014
Branches
Tags
No related merge requests found
......@@ -329,9 +329,18 @@ class ElementInformationController {
$extraFields['crdate'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xlf:LGL.creationDate', TRUE);
$extraFields['cruser_id'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xlf:LGL.creationUserId', TRUE);
$extraFields['tstamp'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xlf:LGL.timestamp', TRUE);
// check if the special fields are defined in the TCA ctrl section of the table
foreach ($extraFields as $fieldName => $fieldLabel) {
if (isset($GLOBALS['TCA'][$this->table]['ctrl'][$fieldName])) {
$extraFields[$GLOBALS['TCA'][$this->table]['ctrl'][$fieldName]] = $fieldLabel;
} else {
unset($extraFields[$fieldName]);
}
}
}
foreach ($extraFields as $name => $value) {
foreach ($extraFields as $name => $fieldLabel) {
$rowValue = '';
if (!isset($this->row[$name])) {
$resourceObject = $this->fileObject ?: $this->folderObject;
......@@ -345,8 +354,9 @@ class ElementInformationController {
} else {
$rowValue = BackendUtility::getProcessedValueExtra($this->table, $name, $this->row[$name]);
}
// show the backend username who created the issue
if ($name === 'cruser_id' && $rowValue) {
$userTemp = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('username, realName', 'be_users', 'uid = ' . (int)$rowValue);
$userTemp = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('username, realName', 'be_users', 'uid = ' . (int)$rowValue);
if ($userTemp[0]['username'] !== '') {
$rowValue = $userTemp[0]['username'];
if ($userTemp[0]['realName'] !== '') {
......@@ -356,7 +366,7 @@ class ElementInformationController {
}
$tableRows[] = '
<tr>
<th>' . rtrim($value, ':') . '</th>
<th>' . rtrim($fieldLabel, ':') . '</th>
<td>' . htmlspecialchars($rowValue) . '</td>
</tr>';
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment