From 80cc945ebaba47a6728df56cf72e2050aa334f52 Mon Sep 17 00:00:00 2001 From: paulobrien Date: Wed, 3 May 2017 18:22:15 +0100 Subject: [PATCH 1/4] Allow form item replacement in redirect location (#144) --- form.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/form.php b/form.php index 80c92663..8caff704 100644 --- a/form.php +++ b/form.php @@ -343,7 +343,14 @@ public function onFormProcessed(Event $event) break; case 'redirect': $this->grav['session']->setFlashObject('form', $form); - $this->grav->redirect((string)$params); + $url = ((string)$params); + $vars = array( + 'form' => $form + ); + /** @var Twig $twig */ + $twig = $this->grav['twig']; + $url = $twig->processString($url, $vars); + $this->grav->redirect($url); break; case 'reset': if (Utils::isPositive($params)) { From ab688459a46c86b30a5c89ecb6b8bfa69de59b85 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Thu, 4 May 2017 11:10:59 +0200 Subject: [PATCH 2/4] Changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2631bf58..c0a4c4d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v2.6.0 +## 05/04/2017 + +1. [](#new) + * Allow form item replacement in redirect location [#144](https://github.com/getgrav/grav-plugin-form/issues/144) + # v2.5.0 ## 04/24/2017 From 47718f9be8f711987e1595d9b0c15399c139b502 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Thu, 4 May 2017 11:28:57 +0200 Subject: [PATCH 3/4] Fix regression with file uploads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduced by https://github.com/getgrav/grav-plugin-form/commit/ddf6e40cd8bc5f46a8218 37cdc52bd07af5f6c48 The file upload does not rely on ‘data’, so it was failing --- CHANGELOG.md | 2 ++ form.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0a4c4d9..69852e0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ 1. [](#new) * Allow form item replacement in redirect location [#144](https://github.com/getgrav/grav-plugin-form/issues/144) +1. [](#bugfix) + * Fix regression with file uploads introduced in 2.5.0 # v2.5.0 ## 04/24/2017 diff --git a/form.php b/form.php index 8caff704..153a0665 100644 --- a/form.php +++ b/form.php @@ -181,7 +181,7 @@ public function onPagesInitialized() } // Handle posting if needed. - if (!empty($_POST) && isset($_POST['data'])) { + if (!empty($_POST) && (isset($_POST['data']) || isset($_POST['__form-file-uploader__']))) { $current_form_name = $this->getFormName($this->grav['page']); $this->json_response = []; From fc6cc30d62026272ee88ac24f19eb8c143e1ec1c Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Thu, 4 May 2017 11:30:02 +0200 Subject: [PATCH 4/4] Prepare release --- blueprints.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprints.yaml b/blueprints.yaml index 83ca45d0..b9653690 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Form -version: 2.5.0 +version: 2.6.0 description: Enables the forms handling icon: check-square author: