Upgrade Kirby from 4.3.0 to 4.4.0

This commit is contained in:
Timothée Goguely 2024-09-12 17:37:56 +02:00
parent 03905dbd83
commit 3bed01af75
293 changed files with 54254 additions and 187 deletions

View file

@ -352,12 +352,15 @@ class File extends Model
$id = $this->model->id();
if (empty($params['model']) === false) {
$parent = $this->model->parent();
$parent = $this->model->parent();
$absolute = $parent !== $params['model'];
// if the file belongs to the current parent model,
// store only name as ID to keep its path relative to the model
$id = $parent === $params['model'] ? $name : $id;
$absolute = $parent !== $params['model'];
$id = match ($absolute) {
true => $id,
false => $name
};
}
$params['text'] ??= '{{ file.filename }}';
@ -399,6 +402,7 @@ class File extends Model
'template' => $file->template(),
'type' => $file->type(),
'url' => $file->url(),
'uuid' => fn () => $file->uuid()?->toString(),
],
'preview' => [
'focusable' => $this->isFocusable(),

View file

@ -335,7 +335,7 @@ abstract class Model
'link' => $this->url(true),
'sortable' => true,
'text' => $this->model->toSafeString($params['text'] ?? false),
'uuid' => $this->model->uuid()?->toString() ?? $this->model->id(),
'uuid' => $this->model->uuid()?->toString()
];
}

View file

@ -339,6 +339,7 @@ class Page extends Model
'previewUrl' => $page->previewUrl(),
'status' => $page->status(),
'title' => $page->title()->toString(),
'uuid' => fn () => $page->uuid()?->toString(),
],
'status' => function () use ($page) {
if ($status = $page->status()) {

View file

@ -71,6 +71,7 @@ class Site extends Model
'link' => $this->url(true),
'previewUrl' => $this->model->previewUrl(),
'title' => $this->model->title()->toString(),
'uuid' => fn () => $this->model->uuid()?->toString(),
]
]);
}

View file

@ -237,6 +237,7 @@ class User extends Model
'name' => $user->name()->toString(),
'role' => $user->role()->title(),
'username' => $user->username(),
'uuid' => fn () => $user->uuid()?->toString()
]
]
);