Fixed issue with admin page using default expires, now forces 0 #1009

This commit is contained in:
Andy Miller
2017-03-08 15:36:28 -07:00
parent ba229a318a
commit 8a84626935
2 changed files with 6 additions and 0 deletions

View File

@@ -10,8 +10,10 @@
* Separated user details and avatar in separate twig to allow more granular overriding in plugins [#989](https://github.com/getgrav/grav-plugin-admin/issues/989)
* Nicer layout of themes list on wider screen
* Use native OS highlight colors for the editor [#977](https://github.com/getgrav/grav-plugin-admin/issues/977)
* Force admin pages to set `Page::expires(0)` so it's not cached [#1009](https://github.com/getgrav/grav-plugin-admin/issues/1009)
1. [](#bugfix)
* Fixed rendering issue with Chrome and sortables collections [#1002](https://github.com/getgrav/grav-plugin-admin/issues/1002)
# v1.2.14
## 02/17/2017

View File

@@ -390,11 +390,15 @@ class AdminPlugin extends Plugin
$this->grav['page'] = function () use ($self) {
$page = new Page;
$page->expires(0);
// If the page cannot be found in other plugins, try looking in admin plugin itself.
if (file_exists(__DIR__ . "/pages/admin/{$self->template}.md")) {
$page->init(new \SplFileInfo(__DIR__ . "/pages/admin/{$self->template}.md"));
$page->slug(basename($self->template));
return $page;
}