Update to Kirby 3.7.5

This commit is contained in:
Nico Hoffmann
2022-08-30 20:43:20 +02:00
parent d89a0a647c
commit 26541380c4
45 changed files with 191 additions and 199 deletions

View File

@@ -461,7 +461,6 @@ class App
}
if ($contentType !== 'html') {
// no luck for a specific representation controller?
// let's try the html controller instead
if ($controller = $this->controllerLookup($name)) {

View File

@@ -506,7 +506,6 @@ class Blueprint
}
foreach ($fields as $fieldName => $fieldProps) {
// extend field from string
if (is_string($fieldProps) === true) {
$fieldProps = [
@@ -600,7 +599,6 @@ class Blueprint
protected function normalizeSections(string $tabName, array $sections): array
{
foreach ($sections as $sectionName => $sectionProps) {
// unset / remove section if its property is false
if ($sectionProps === false) {
unset($sections[$sectionName]);
@@ -686,7 +684,6 @@ class Blueprint
}
foreach ($tabs as $tabName => $tabProps) {
// unset / remove tab if its property is false
if ($tabProps === false) {
unset($tabs[$tabName]);

View File

@@ -106,7 +106,6 @@ class Email
protected function template(): void
{
if (isset($this->props['template']) === true) {
// prepare data to be passed to template
$data = $this->props['data'] ?? [];
@@ -123,7 +122,7 @@ class Email
$this->props['body']['text'] = $text->render($data);
}
// fallback to single email text template
// fallback to single email text template
} elseif ($text->exists()) {
$this->props['body'] = $text->render($data);
} else {

View File

@@ -194,7 +194,6 @@ trait FileActions
// run the hook
return $file->commit('create', compact('file', 'upload'), function ($file, $upload) {
// delete all public versions
$file->unpublish();
@@ -230,7 +229,6 @@ trait FileActions
public function delete(): bool
{
return $this->commit('delete', ['file' => $this], function ($file) {
// remove all versions in the media folder
$file->unpublish();
@@ -289,7 +287,6 @@ trait FileActions
];
return $this->commit('replace', $arguments, function ($file, $upload) {
// delete all public versions
$file->unpublish();

View File

@@ -60,7 +60,6 @@ class LanguageRouter
// only keep the scoped language routes
$routes = array_values(array_filter($routes, function ($route) use ($language) {
// no language scope
if (empty($route['language']) === true) {
return false;
@@ -82,7 +81,6 @@ class LanguageRouter
foreach ($routes as $index => $route) {
if ($pageId = ($route['page'] ?? null)) {
if ($page = $kirby->page($pageId)) {
// convert string patterns to arrays
$patterns = A::wrap($route['pattern']);

View File

@@ -23,7 +23,6 @@ class LanguageRoutes
$baseurl = $kirby->url();
foreach ($kirby->languages() as $language) {
// ignore languages with a different base url
if ($language->baseurl() !== $baseurl) {
continue;
@@ -66,7 +65,6 @@ class LanguageRoutes
'method' => 'ALL',
'env' => 'site',
'action' => function (string $path) use ($kirby) {
// check for content representations or files
$extension = F::extension($path);
@@ -115,7 +113,6 @@ class LanguageRoutes
'method' => 'ALL',
'env' => 'site',
'action' => function () use ($kirby) {
// find all languages with the same base url as the current installation
$languages = $kirby->languages()->filter('baseurl', $kirby->url());

View File

@@ -41,7 +41,6 @@ class Media
// try to find a file by model and filename
// this should work for all original files
if ($file = $model->file($filename)) {
// check if the request contained an outdated media hash
if ($file->mediaHash() !== $hash) {
// if at least the token was correct, redirect

View File

@@ -83,7 +83,6 @@ abstract class ModelWithContent extends Model
*/
public function content(string $languageCode = null)
{
// single language support
if ($this->kirby()->multilang() === false) {
if (is_a($this->content, 'Kirby\Cms\Content') === true) {
@@ -95,7 +94,6 @@ abstract class ModelWithContent extends Model
// multi language support
} else {
// only fetch from cache for the default language
if ($languageCode === null && is_a($this->content, 'Kirby\Cms\Content') === true) {
return $this->content;

View File

@@ -478,7 +478,6 @@ trait PageActions
// run the hooks and creation action
$page = $page->commit('create', ['page' => $page, 'input' => $props], function ($page, $props) {
// always create pages in the default language
if ($page->kirby()->multilang() === true) {
$languageCode = $page->kirby()->defaultLanguage()->code();
@@ -594,7 +593,6 @@ trait PageActions
public function delete(bool $force = false): bool
{
return $this->commit('delete', ['page' => $this, 'force' => $force], function ($page, $force) {
// delete all files individually
foreach ($page->files() as $file) {
$file->delete();
@@ -607,7 +605,6 @@ trait PageActions
// actually remove the page from disc
if ($page->exists() === true) {
// delete all public media files
Dir::remove($page->mediaRoot());

View File

@@ -119,7 +119,6 @@ class PageBlueprint extends Blueprint
// clean up and translate each status
foreach ($status as $key => $options) {
// skip invalid status definitions
if (in_array($key, ['draft', 'listed', 'unlisted']) === false || $options === false) {
unset($status[$key]);

View File

@@ -648,7 +648,6 @@ class User extends ModelWithContent
// if there's an authenticated user …
if ($user = $kirby->user()) {
// admin users can select pretty much any role
if ($user->isAdmin() === true) {
// except if the user is the last admin