Skip to content

Commit

Permalink
Fixed issue with admin page using default expires, now forces 0 #1009
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Mar 8, 2017
1 parent ba229a3 commit 8a84626
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,15 @@ public function onPagesInitialized()
$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;
}

Expand Down

1 comment on commit 8a84626

@merenbach
Copy link

@merenbach merenbach commented on 8a84626 Mar 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhukster Nice! Thank you for such an amazingly responsive turnaround. As I alluded earlier, I'm wondering if caching is somehow related to the invalid security token popups. I will keep my eyes peeled to see if it's fixed.

Please sign in to comment.