Skip to content

Commit 2243bf3

Browse files
committed
Merge branch 'release/6.0.0'
2 parents 4a47407 + 7a87277 commit 2243bf3

File tree

17 files changed

+783
-429
lines changed

17 files changed

+783
-429
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# v6.0.0
2+
## 03/28/2022
3+
4+
1. [](#improved)
5+
* Added log warning when trying to access form by non-unique name
6+
* Optimized form caching by not initializing the forms in `onPageProcessed` event anymore
7+
* **BACKWARD COMPATIBILITY**: As form initialization has been delayed, logic relaying on `onPageProcessed` with forms may not work anymore
8+
1. [](#bugfix)
9+
* Fixed select field where option is iterable (#558)
10+
* Fixed `FormPlugin::getForm()` to properly search the current page first
11+
* Fixed `FormPlugin::getForm()` to ignore fallback if the page was given as parameter
12+
* Fixed dynamic forms to work with cache turned on
13+
* Fix nested `toggleable`: originalValue now checks with `??` instead of `is defined`
14+
115
# v5.1.7
216
## 03/14/2022
317

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Note: when using email functionality in your forms, make sure you have configure
3030

3131
# NOTES:
3232

33+
As of version **Form 6.0.0** forms are no longer initialized before caching, but when the form is requested. This has been done to make dynamic forms to work better with caching. There may be some backward compatibility issues for logic that modifies pages with forms as the modification doesn't happen without accessing the form first.
34+
3335
As of version **Form 5.0.0** Grav 1.7+ is required.
3436

3537
As of version **Form 4.0.6**, form labels are now being output with the `|raw` filter. If you wish to show HTML in your form label, ie `Root Folder <root>`, then you need to escape that in your form definition:

blueprints.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Form
22
slug: form
33
type: plugin
4-
version: 5.1.7
4+
version: 6.0.0
55
description: Enables the forms handling
66
icon: check-square
77
author:

classes/Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function __construct(PageInterface $page, $name = null, $form = null)
119119
$this->items = $form;
120120
} else {
121121
// Otherwise get all forms in the page.
122-
$forms = $page->forms();
122+
$forms = $page->getForms();
123123
if ($name) {
124124
// If form with given name was found, use that.
125125
$this->items = $forms[$name] ?? [];

classes/Forms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function setActiveForm(FormInterface $form): void
113113
*/
114114
protected function getPageParameters(PageInterface $page, ?string $name): array
115115
{
116-
$forms = $page->forms();
116+
$forms = $page->getForms();
117117

118118
if ($name) {
119119
// If form with given name was found, use that.

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)