Update Composer packages
This commit is contained in:
parent
67c3d8b307
commit
83cb211fe6
219 changed files with 6487 additions and 4444 deletions
|
@ -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');
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
]
|
||||
];
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue