Skip to content

Commit

Permalink
[TASK] Allow an error from PreviewView if given a bad template path
Browse files Browse the repository at this point in the history
Providers already deliver NULL if a template file cannot be resolved. Errors that stem from incorrect template references should be allowed to pass through (and will then be catchable as Exceptions from the outside).
  • Loading branch information
NamelessCoder committed Sep 13, 2015
1 parent fb81da1 commit 4f7986a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Classes/View/PreviewView.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,8 @@ public function getPreview(ProviderInterface $provider, array $row) {
$form = $provider->getForm($row);
$options = $this->getPreviewOptions($form);
$mode = $this->getOptionMode($options);
if (FALSE === file_exists($provider->getTemplatePathAndFilename($row))) {
$previewContent = '';
} else {
$previewContent = $this->renderPreviewSection($provider, $row, $form);
}
$previewContent = (string) $this->renderPreviewSection($provider, $row, $form);

if (self::MODE_NONE === $mode || FALSE === is_object($form)) {
return $previewContent;
}
Expand Down

0 comments on commit 4f7986a

Please sign in to comment.