diff --git a/app/main/template/ComponentPartial.php b/app/main/template/ComponentPartial.php index 7c5d95b680..724759e6b5 100644 --- a/app/main/template/ComponentPartial.php +++ b/app/main/template/ComponentPartial.php @@ -174,19 +174,17 @@ public function getFilePath($fileName = null) $component = $this->component; $componentPath = $component->getPath(); - foreach (['.blade.', '.'] as $part) { - $basename = $fileName; - if (!strlen(File::extension($basename))) - $basename .= $part.$this->defaultExtension; - - if (File::isFile($path = $componentPath.'/'.$basename)) - return $path; - - // Check the shared "/partials" directory for the partial - $sharedPath = dirname($componentPath).'/partials/'.$basename; - if (File::isFile($sharedPath)) { - return $sharedPath; - } + $basename = $fileName; + if (!strlen(File::extension($basename))) + $basename .= '.blade.'.$this->defaultExtension; + + if (File::isFile($path = $componentPath.'/'.$basename)) + return $path; + + // Check the shared "/partials" directory for the partial + $sharedPath = dirname($componentPath).'/partials/'.$basename; + if (File::isFile($sharedPath)) { + return $sharedPath; } return $componentPath.'/'.$fileName; diff --git a/app/system/traits/ViewMaker.php b/app/system/traits/ViewMaker.php index fa075aa772..ab5b82e285 100644 --- a/app/system/traits/ViewMaker.php +++ b/app/system/traits/ViewMaker.php @@ -45,7 +45,7 @@ trait ViewMaker */ public $suppressLayout = FALSE; - protected $viewFileExtension = ['.blade.php', '.php']; + protected $viewFileExtension = ['.blade.php']; public function getViewPath($view, $viewPath = null) {