What is your Kirby version?
3.5.0
What is your environment? Local, remote server? PHP version? server type?
It happens locally (macOS Big Sur with MAMP running PHP 7.4.12 using Apache) and also on a remote server (shared Linux webhosting running PHP 7.4.13 using Apache).
What is in your config?
return [
'cache' => [
'pages' => [
'active' => true
]
],
'home' => 'projekte',
'routes' => [
[
// block unwanted urls (including language specific urls)
'pattern' => [
'(:any)/xxx/xxx/(:any)',
'xxx/xxx/(:any)',
'(:any)/xxx/xxx',
'xxx/xxx',
'(:any)/xxx/xxx/(:any)',
'xxx/xxx/(:any)',
'(:any)/xxx/xxx',
'xxx/xxx'
],
'action' => function() {
return false;
}
],
[
// look for project urls with or without gallery index
'pattern' => [
'xxx/(:any)/(:num)',
'xxx/(:any)',
'xxx/(:any)/(:num)',
'xxx/(:any)'
],
'language' => '*',
'action' => function($language, $slug, $index = 0) {
// add index if there is none
if (!$index) {
// FIXME: not very resilient
if ($language == 'de') {
$base = 'xxx/';
} else {
$base = 'en/xxx/';
};
return go($base . $slug . '/1');
} else {
return site()->visit('xxx/' . $slug, $language);
};
}
],
[
// look for collection urls with or without gallery index
'pattern' => [
'xxx/(:any)/(:num)',
'xxx/(:any)',
'xxx/(:any)/(:num)',
'xxx/(:any)'
],
'language' => '*',
'action' => function($language, $title, $index = 0) {
$slug = 'xxx/xxx/' . $title;
$collection = page($slug);
if ($collection) {
if ($index) {
$galleryType = $collection->galleryType();
$selection = $collection->selection()->yaml();
$title = $collection->content($language)->title();
// return virtual page based on template
$project = new Page([
'slug' => $slug . '/' . $index,
'template' => 'project',
'content' => [
'galleryType' => $galleryType,
'selection' => $selection,
'title' => $title
]
]);
// return the virtual page in the current language
return site()->visit($project, $language);
} else {
// return the page in the current language
return site()->visit($slug, $language);
}
};
return false;
}
],
[
// look for category urls
'pattern' => '(:any)',
'language' => '*',
'action' => function($language, $slug) {
// get category names in current language
$categories = page('xxx')->content($language)->categories()->toStructure();
$category = $categories->filter(function($element) use($slug) {
return str::slug($element->name()) == $slug;
});
// make sure there is only one category
$category = $category->first();
if ($category) {
// start with equal slugs
$en_slug = $de_slug = $slug;
// get translated slug for inactive language
if ($language == 'en') {
$de_slug = str::slug(page('xxx')->content('de')->categories()->toStructure()->findBy('id', $category->id())->name());
} else {
$en_slug = str::slug(page('xxx')->content('en')->categories()->toStructure()->findBy('id', $category->id())->name());
}
$translated_slug = page('xxx')->content($language)->categories()->toStructure();
// return virtual page based on template
$category_page = new Page([
'slug' => $slug,
'template' => 'portfolio',
'translations' => [
'en' => [
'code' => 'en',
'slug' => $en_slug
],
'de' => [
'code' => 'de',
'slug' => $de_slug
]
],
'content' => [
'title' => $category->name(),
'category' => $category
]
]);
return site()->visit($category_page, $language);
};
return $this->next();
}
],
],
'smartypants' => true,
'thumbs' => [
'presets' => [
'400' => ['width' => 400],
'400@2x' => ['width' => 800],
'1200' => ['width' => 1200],
'1600' => ['width' => 1600],
'1200@2x' => ['width' => 2400]
]
]
];
(I replaced the actual page names and URLs for privacy reasons.)
The second and fourth custom route apply to the page where I upload the files and the errors occur—they may have to do with this.
I also update URLs in two page models but the errors still occur when I comment the lines out.
Thank you, as always, for getting back so quickly @texnixe !