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

@@ -56,11 +56,14 @@ return [
}
return $api->upload(function ($source, $filename) use ($parent, $params, $map) {
$file = $parent->createFile([
$props = [
'source' => $source,
'template' => $params['template'] ?? null,
'filename' => $filename,
]);
];
// move the source file from the temp dir
$file = $parent->createFile($props, true);
if ($file instanceof File === false) {
throw new Exception('The file could not be uploaded');

View File

@@ -1,5 +1,7 @@
<?php
use Kirby\Field\FieldOptions;
return [
'extends' => 'radio',
'props' => [
@@ -20,5 +22,16 @@ return [
'placeholder' => function (string $placeholder = '—') {
return $placeholder;
},
],
'methods' => [
'getOptions' => function () {
$props = FieldOptions::polyfill($this->props);
// disable safe mode as the select field does not
// render HTML for the option text
$options = FieldOptions::factory($props['options'], false);
return $options->render($this->model());
}
]
];

View File

@@ -10,7 +10,7 @@ return [
* The field value will be converted with the selected converter before the value gets saved. Available converters: `lower`, `upper`, `ucfirst`, `slug`
*/
'converter' => function ($value = null) {
if ($value !== null && in_array($value, array_keys($this->converters())) === false) {
if ($value !== null && array_key_exists($value, $this->converters()) === false) {
throw new InvalidArgumentException([
'key' => 'field.converter.invalid',
'data' => ['converter' => $value]