Skip to content

Commit

Permalink
Merge branch 'release/2.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviocopes committed May 4, 2017
2 parents f11e707 + fc6cc30 commit 7d34f24
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 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)
1. [](#bugfix)
* Fix regression with file uploads introduced in 2.5.0

# v2.5.0
## 04/24/2017

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Form
version: 2.5.0
version: 2.6.0
description: Enables the forms handling
icon: check-square
author:
Expand Down
11 changes: 9 additions & 2 deletions form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 7d34f24

Please sign in to comment.