Skip to content

Commit

Permalink
[BUGFIX] Catch exception when “new” icon is missing
Browse files Browse the repository at this point in the history
Temporary measure is to use a text `[+]` link. The button still has a label so it should be clear what it does.
  • Loading branch information
NamelessCoder committed Jan 11, 2018
1 parent 35d4b47 commit a4d9730
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Classes/View/PreviewView.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Database\DatabaseConnection;
use TYPO3\CMS\Core\Exception;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
Expand Down Expand Up @@ -454,7 +455,11 @@ protected function drawNewIcon(array $row, Column $column, $after = 0)
$columnName = $column->getName();
$after = (false === empty($columnName) && false === empty($after)) ? '-' . $after : $row['pid'];
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$icon = $iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render();
try {
$icon = $iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render();
} catch (Exception $exception) {
$icon = '[+]';
}
$uri = $this->getNewLink($row, $after, $columnName);
$title = $this->getLanguageService()->getLL('newRecordHere');
$inner = $this->getLanguageService()->getLL('content');
Expand Down

0 comments on commit a4d9730

Please sign in to comment.