diff --git a/system/blueprints/user/account.yaml b/system/blueprints/user/account.yaml index b5cde9bcd..b48e79007 100644 --- a/system/blueprints/user/account.yaml +++ b/system/blueprints/user/account.yaml @@ -126,3 +126,4 @@ form: ignore_empty: true validate: type: array + value_type: bool diff --git a/system/blueprints/user/group.yaml b/system/blueprints/user/group.yaml index ddb7d242c..3ab07546f 100644 --- a/system/blueprints/user/group.yaml +++ b/system/blueprints/user/group.yaml @@ -45,3 +45,4 @@ form: ignore_empty: true validate: type: array + value_type: bool diff --git a/system/src/Grav/Common/Data/Validation.php b/system/src/Grav/Common/Data/Validation.php index 30666dbf9..2764067fa 100644 --- a/system/src/Grav/Common/Data/Validation.php +++ b/system/src/Grav/Common/Data/Validation.php @@ -720,7 +720,13 @@ class Validation if ($type && $val !== '' && $val !== null) { switch ($type) { case 'bool': - $val = Utils::isPositive($val); + if (Utils::isPositive($val)) { + $val = true; + } elseif (Utils::isNegative($val)) { + $val = false; + } else { + $val = null; + } break; case 'int': $val = (int)$val;