1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 10:15:28 +02:00

Fix issue processwire/processwire-issues#80 where missing site/templates/admin.php file rendered blank output rather than throwing exception

This commit is contained in:
Ryan Cramer
2016-11-15 08:03:55 -05:00
parent a98cd1b351
commit ab7b7a6380

View File

@@ -371,7 +371,6 @@ class PageRender extends WireData implements Module, ConfigurableModule {
* variables of your own names to $options as needed for communication with the template, if it suits your need.
*
* @param HookEvent $event
* @return string rendered data
* @throws WirePermissionException|WireException
*
*/
@@ -514,6 +513,9 @@ class PageRender extends WireData implements Module, ConfigurableModule {
$profilerEvent = $profiler ? $profiler->start($page->path, $this, array('page' => $page)) : null;
$data = $output->render();
if($profilerEvent) $profiler->stop($profilerEvent);
if(!strlen($data) && $page->template->name === 'admin' && !is_readable($options['filename'])) {
throw new WireException('Missing or non-readable template file: ' . basename($options['filename']));
}
}
if($data && $cacheAllowed && $cacheFile) $cacheFile->save($data);