Update Kirby and dependencies

This commit is contained in:
Paul Nicoué 2022-06-17 18:02:55 +02:00
parent 750b9cc83e
commit 8c71a258b6
59 changed files with 2143 additions and 813 deletions

View file

@ -16,8 +16,7 @@ return [
'page.changeSort' => [
'pattern' => 'pages/(:any)/changeSort',
'load' => function (string $id) {
$page = Find::page($id);
$position = null;
$page = Find::page($id);
if ($page->blueprint()->num() !== 'default') {
throw new PermissionException([

View file

@ -5,6 +5,7 @@ fields:
images:
label: field.blocks.gallery.images.label
type: files
query: model.images
multiple: true
layout: cards
size: tiny

View file

@ -13,6 +13,7 @@ fields:
image:
label: field.blocks.image.name
type: files
query: model.images
multiple: false
image:
back: black

View file

@ -168,7 +168,7 @@ return [
* @return \Kirby\Cms\Collection|bool
*/
'search' => function (App $kirby, Collection $collection, string $query = null, $params = []) {
if (empty(trim($query)) === true) {
if (empty(trim($query ?? '')) === true) {
return $collection->limit(0);
}

View file

@ -69,14 +69,13 @@ return [
return $value;
}
$value = trim($value);
$converter = $this->converters()[$this->converter()];
if (is_array($value) === true) {
return array_map($converter, $value);
}
return call_user_func($converter, $value);
return call_user_func($converter, trim($value ?? ''));
},
'converters' => function (): array {
return [

View file

@ -112,11 +112,11 @@ return function (App $app) {
* Converts the field value to a timestamp or a formatted date
*
* @param \Kirby\Cms\Field $field
* @param string|null $format PHP date formatting string
* @param string|\IntlDateFormatter|null $format PHP date formatting string
* @param string|null $fallback Fallback string for `strtotime` (since 3.2)
* @return string|int
*/
'toDate' => function (Field $field, string $format = null, string $fallback = null) use ($app) {
'toDate' => function (Field $field, $format = null, string $fallback = null) use ($app) {
if (empty($field->value) === true && $fallback === null) {
return null;
}

View file

@ -12,7 +12,8 @@ return [
'form' => function () {
$fields = $this->fields;
$disabled = $this->model->permissions()->update() === false;
$content = $this->model->content()->toArray();
$lang = $this->model->kirby()->languageCode();
$content = $this->model->content($lang)->toArray();
if ($disabled === true) {
foreach ($fields as $key => $props) {

View file

@ -6,9 +6,16 @@ return [
'props' => [
/**
* The headline for the section. This can be a simple string or a template with additional info from the parent page.
* @todo deprecate in 3.7
*/
'headline' => function ($headline = null) {
return I18n::translate($headline, $headline);
},
/**
* label is the new official replacement for headline
*/
'label' => function ($label = null) {
return I18n::translate($label, $label);
}
],
'computed' => [
@ -17,6 +24,10 @@ return [
return $this->model()->toString($this->headline);
}
if ($this->label) {
return $this->model()->toString($this->label);
}
return ucfirst($this->name);
}
]