Commit 7e09286f authored by Michael Oehlhof's avatar Michael Oehlhof Committed by Christian Kuhn
Browse files

[BUGFIX] Removed call to render() after getFlashMessageForMissingFile

Replace calls to deprecated method render() and to the function
getFlashMessageForMissingFile() with appropriate html code.

Resolves: #72508
Releases: master, 7.6
Change-Id: I90846f8349726e88dfa6aa77ab595fe28280e81b
Reviewed-on: https://review.typo3.org/45554

Reviewed-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
Reviewed-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 53b87711
......@@ -17,4 +17,11 @@
}
.label-block {
display: block;
}
.label-space-left {
margin-left: 1em;
}
.label-space-right {
margin-right: 1em;
}
\ No newline at end of file
......@@ -276,8 +276,9 @@ class ElementInformationController
// check if file is marked as missing
if ($this->fileObject->isMissing()) {
$flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($this->fileObject);
$previewTag .= $flashMessage->render();
$previewTag .= '<span class="label label-danger">'
. htmlspecialchars(static::getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:warning.file_missing'))
. '</span>&nbsp;' . htmlspecialchars($this->fileObject->getName()) . '<br />';
} else {
/** @var \TYPO3\CMS\Core\Resource\Rendering\RendererRegistry $rendererRegistry */
......
......@@ -315,8 +315,9 @@ class InlineRecordContainer extends AbstractContainer
$fileObject = null;
}
if ($fileObject && $fileObject->isMissing()) {
$flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($fileObject);
$thumbnail = $flashMessage->render();
$thumbnail .= '<span class="label label-danger">'
. htmlspecialchars(static::getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:warning.file_missing'))
. '</span>&nbsp;' . htmlspecialchars($fileObject->getName()) . '<br />';
} elseif ($fileObject) {
$imageSetup = $inlineConfig['appearance']['headerThumbnail'];
unset($imageSetup['field']);
......
......@@ -137,7 +137,9 @@ class GroupElement extends AbstractFormElement
$fileObject = $fileFactory->getFileObject($imgP[0]);
if ($fileObject->isMissing()) {
$thumbnails[] = array(
'message' => \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($fileObject)->render()
'message' => '<span class="label label-danger">'
. htmlspecialchars(static::getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:warning.file_missing'))
. '</span>&nbsp;' . htmlspecialchars($fileObject->getName()) . '<br />'
);
} elseif (GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $fileObject->getExtension())) {
$thumbnails[] = array(
......
......@@ -1446,8 +1446,9 @@ class BackendUtility
$fileObject = $fileReferenceObject->getOriginalFile();
if ($fileObject->isMissing()) {
$flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($fileObject);
$thumbData .= $flashMessage->render();
$thumbData .= '<span class="label label-danger">'
. htmlspecialchars(static::getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:warning.file_missing'))
. '</span>&nbsp;' . htmlspecialchars($fileObject->getName()) . '<br />';
continue;
}
......@@ -1496,18 +1497,15 @@ class BackendUtility
continue;
}
if ($fileObject->isMissing()) {
$flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($fileObject);
$thumbData .= $flashMessage->render();
$thumbData .= '<span class="label label-danger">'
. htmlspecialchars(static::getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:warning.file_missing'))
. '</span>&nbsp;' . htmlspecialchars($fileObject->getName()) . '<br />';
continue;
}
} catch (ResourceDoesNotExistException $exception) {
/** @var FlashMessage $flashMessage */
$flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class,
htmlspecialchars($exception->getMessage()),
static::getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:warning.file_missing', true),
FlashMessage::ERROR
);
$thumbData .= $flashMessage->render();
$thumbData .= '<span class="label label-danger">'
. htmlspecialchars(static::getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:warning.file_missing'))
. '</span>&nbsp;' . htmlspecialchars($fileName) . '<br />';
continue;
}
......
......@@ -75,8 +75,9 @@ class FileInfoHook
$previewImage = $processedFile->getPublicUrl(true);
$content = '';
if ($file->isMissing()) {
$flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($file);
$content .= $flashMessage->render();
$content .= '<span class="label label-danger label-space-right">'
. htmlspecialchars($lang->sL('LLL:EXT:lang/locallang_core.xlf:warning.file_missing'))
. '</span>';
}
if ($previewImage) {
$content .= '<img src="' . htmlspecialchars($previewImage) . '" ' .
......
......@@ -711,8 +711,9 @@ class FileList extends AbstractRecordList
$theData[$field] = $this->linkWrapFile(htmlspecialchars($fileName), $fileObject);
if ($fileObject->isMissing()) {
$flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($fileObject);
$theData[$field] .= $flashMessage->render();
$theData[$field] .= '<span class="label label-danger label-space-left">'
. htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:warning.file_missing'))
. '</span>';
// Thumbnails?
} elseif ($this->thumbs && ($this->isImage($ext) || $this->isMediaFile($ext))) {
$processedFile = $fileObject->process(ProcessedFile::CONTEXT_IMAGEPREVIEW, array());
......
......@@ -11343,6 +11343,12 @@ ul.tree div.treeLinkItem span.dragIcon {
.label-block {
display: block;
}
.label-space-left {
margin-left: 1em;
}
.label-space-right {
margin-right: 1em;
}
.badge-info {
background-color: #6daae0;
}
......
Supports Markdown
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