mirror of
https://github.com/getgrav/grav.git
synced 2026-07-13 20:23:46 +02:00
Bluprints: Move validation parameter inside the form
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
title: Media
|
||||
validation: loose
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
title: Site
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
content:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
title: File Streams
|
||||
validation: loose
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
schemes.xxx:
|
||||
type: array
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
title: System
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
content:
|
||||
|
||||
@@ -5,6 +5,7 @@ rules:
|
||||
max: 80
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
title:
|
||||
|
||||
@@ -5,6 +5,7 @@ rules:
|
||||
max: 80
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
tabs:
|
||||
|
||||
@@ -5,6 +5,7 @@ rules:
|
||||
max: 80
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
title:
|
||||
|
||||
@@ -5,6 +5,7 @@ rules:
|
||||
max: 80
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
title:
|
||||
|
||||
@@ -5,6 +5,7 @@ rules:
|
||||
max: 80
|
||||
|
||||
form:
|
||||
validation: loose
|
||||
fields:
|
||||
|
||||
tabs:
|
||||
|
||||
@@ -268,7 +268,7 @@ class Blueprint
|
||||
} elseif (is_array($field) && is_array($val)) {
|
||||
// Array has been defined in blueprints.
|
||||
$this->validateArray($field, $val);
|
||||
} elseif (isset($this->items['validation']) && $this->items['validation'] == 'strict') {
|
||||
} elseif (isset($this->items['form']['validation']) && $this->items['form']['validation'] == 'strict') {
|
||||
// Undefined/extra item.
|
||||
throw new \RuntimeException(sprintf('%s is not defined in blueprints', $key));
|
||||
}
|
||||
@@ -294,7 +294,7 @@ class Blueprint
|
||||
} elseif (is_array($field) && is_array($val)) {
|
||||
// Array has been defined in blueprints.
|
||||
$field = $this->filterArray($field, $val);
|
||||
} elseif (isset($this->items['validation']) && $this->items['validation'] == 'strict') {
|
||||
} elseif (isset($this->items['form']['validation']) && $this->items['form']['validation'] == 'strict') {
|
||||
$field = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user