[BUGFIX] Fluid tries to render folders as templates partials and layouts 95/33195/2
authorKrzysztof Adamczyk <k.adamczyk@koptis.com.pl>
Sat, 21 Sep 2013 13:42:31 +0000 (15:42 +0200)
committerMarkus Klein <klein.t3@reelworx.at>
Tue, 7 Oct 2014 21:37:29 +0000 (23:37 +0200)
The file_exists checks in TemplateView and StandaloneView are true for
folders. This leads to unrendered partials with resorted paths.
Use is_file instead.

Releases: master, 6.2, 6.1
Resolves: #47188
Change-Id: I9c168f4793f173f6c2f848e6e3da1f6021ae9c06
Reviewed-on: http://review.typo3.org/33195
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/fluid/Classes/View/StandaloneView.php
typo3/sysext/fluid/Classes/View/TemplateView.php

index 04fd2a1..0d8db74 100644 (file)
@@ -256,7 +256,7 @@ class StandaloneView extends \TYPO3\CMS\Fluid\View\AbstractTemplateView {
                        throw new \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException('No template has been specified. Use either setTemplateSource() or setTemplatePathAndFilename().', 1288085266);
                }
                if ($this->templateSource === NULL) {
-                       if (!file_exists($this->templatePathAndFilename)) {
+                       if (!is_file($this->templatePathAndFilename)) {
                                throw new \TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException('Template could not be found at "' . $this->templatePathAndFilename . '".', 1288087061);
                        }
                        $this->templateSource = file_get_contents($this->templatePathAndFilename);
index 0dbd1de..eb0c6d3 100644 (file)
@@ -470,7 +470,7 @@ class TemplateView extends AbstractTemplateView {
                $paths = $this->expandGenericPathPattern($this->partialPathAndFilenamePattern, TRUE, TRUE);
                foreach ($paths as &$partialPathAndFilename) {
                        $partialPathAndFilename = $this->resolveFileNamePath(str_replace('@partial', $partialName, $partialPathAndFilename));
-                       if (@file_exists($partialPathAndFilename)) {
+                       if (is_file($partialPathAndFilename)) {
                                return $partialPathAndFilename;
                        }
                }