Upgrade to 4.4.1

This commit is contained in:
Bastian Allgeier
2024-09-23 11:46:43 +02:00
parent 8bc7250b68
commit 49287c7a5e
8 changed files with 30 additions and 42 deletions

View File

@@ -70,12 +70,19 @@ return [
'action' => function () {
$kirby = App::instance();
$request = $kirby->request();
$root = $request->get('root');
$page = $kirby->page($request->get('page'));
$parents = $page?->parents()->flip()->values(
fn ($parent) => $parent->uuid()?->toString() ?? $parent->id()
) ?? [];
// if root is included, add the site as top-level parent
if ($root === 'true') {
array_unshift($parents, $kirby->site()->uuid()?->toString() ?? '/');
}
return [
'data' => $page->parents()->flip()->values(
fn ($parent) => $parent->uuid()?->toString() ?? $parent->id()
)
'data' => $parents
];
}
]