From bb9089dc037556b0724b12470482e9138fbacb8e Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 8 Oct 2020 12:11:48 +0300 Subject: [PATCH 1/2] Fixed error page being cached, fixes issue with non-existing resources which later become available --- .gitignore | 9 +++++++++ CHANGELOG.md | 8 +++++++- error.php | 9 +++++++-- pages/error.md | 1 + 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ce2fa3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# OS Generated +.DS_Store* +ehthumbs.db +Icon? +Thumbs.db +*.swp + +# phpstorm +.idea/* diff --git a/CHANGELOG.md b/CHANGELOG.md index 63255fa..6a8c373 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,16 @@ +# v1.7.1 +## mm/dd/2020 + +1. [](#bugfix) + * Fixed error page being cached, fixes issue with non-existing resources which later become available + # v1.7.0 ## 07/01/2020 1. [](#new) * Require Grav v1.6 1. [](#bugfix) - * Added trnaslated title programmatically [#40](https://github.com/getgrav/grav-plugin-error/pull/40) + * Added translated title programmatically [#40](https://github.com/getgrav/grav-plugin-error/pull/40) # v1.6.2 ## 05/09/2019 diff --git a/error.php b/error.php index da0461e..e55caa3 100644 --- a/error.php +++ b/error.php @@ -53,8 +53,13 @@ public function onPageNotFound(Event $event) // Try to load user error page. $page = $pages->dispatch($this->config->get('plugins.error.routes.404', '/error'), true); - - if (!$page) { + if ($page) { + // Set default expires for error page. + $header = $page->header(); + if (!isset($header->expires)) { + $page->expires(0); + } + } else { // If none provided use built in error page. $page = new Page; $page->init(new \SplFileInfo(__DIR__ . '/pages/error.md')); diff --git a/pages/error.md b/pages/error.md index 615b50c..e9b344b 100644 --- a/pages/error.md +++ b/pages/error.md @@ -7,6 +7,7 @@ http_response_code: 404 twig_first: true process: twig: true +expires: 0 --- {{ 'PLUGIN_ERROR.ERROR_MESSAGE'|t }} From a472979194e0d05667ebab32eda1d54ebf3b74c5 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 8 Oct 2020 14:29:53 -0600 Subject: [PATCH 2/2] prepare for release --- CHANGELOG.md | 2 +- blueprints.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a8c373..c3d8e75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v1.7.1 -## mm/dd/2020 +## 10/08/2020 1. [](#bugfix) * Fixed error page being cached, fixes issue with non-existing resources which later become available diff --git a/blueprints.yaml b/blueprints.yaml index 62ab3d8..2192c16 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Error -version: 1.7.0 +version: 1.7.1 description: Displays the error page. type: plugin slug: error