Upgrade to 3.9.0

This commit is contained in:
Bastian Allgeier
2023-01-17 14:50:16 +01:00
parent 0ebe0c7b16
commit 6e5c9d1f48
132 changed files with 1664 additions and 1254 deletions

View File

@@ -62,7 +62,10 @@ class Field extends Component
public function __construct(string $type, array $attrs = [], ?Fields $formFields = null)
{
if (isset(static::$types[$type]) === false) {
throw new InvalidArgumentException('The field type "' . $type . '" does not exist');
throw new InvalidArgumentException([
'key' => 'field.type.missing',
'data' => ['name' => $attrs['name'] ?? '-', 'type' => $type]
]);
}
if (isset($attrs['model']) === false) {

View File

@@ -324,9 +324,7 @@ class Form
return $fields;
}
if ($language === null) {
$language = $kirby->language()->code();
}
$language ??= $kirby->language()->code();
if ($language !== $kirby->defaultLanguage()->code()) {
foreach ($fields as $fieldName => $fieldProps) {