Upgrade to 4.1.0

This commit is contained in:
Bastian Allgeier
2024-01-30 16:41:06 +01:00
parent 5c44c8fcfd
commit 9345fc1a0b
59 changed files with 678 additions and 274 deletions

View File

@@ -147,7 +147,6 @@ class Pages extends Collection
): static {
$model ??= App::instance()->site();
$children = new static([], $model);
$kirby = $model->kirby();
if ($model instanceof Page) {
$parent = $model;
@@ -158,7 +157,6 @@ class Pages extends Collection
}
foreach ($pages as $props) {
$props['kirby'] = $kirby;
$props['parent'] = $parent;
$props['site'] = $site;
$props['isDraft'] = $draft ?? $props['isDraft'] ?? $props['draft'] ?? false;
@@ -445,9 +443,10 @@ class Pages extends Collection
$templates = [$templates];
}
return $this->filter(function ($page) use ($templates) {
return !in_array($page->intendedTemplate()->name(), $templates);
});
return $this->filter(
fn ($page) =>
!in_array($page->intendedTemplate()->name(), $templates)
);
}
/**
@@ -480,9 +479,10 @@ class Pages extends Collection
$templates = [$templates];
}
return $this->filter(function ($page) use ($templates) {
return in_array($page->intendedTemplate()->name(), $templates);
});
return $this->filter(
fn ($page) =>
in_array($page->intendedTemplate()->name(), $templates)
);
}
/**