Upgrade to 3.8.0

This commit is contained in:
Bastian Allgeier
2022-10-06 10:11:54 +02:00
parent a9ed4e45ca
commit 7d168aae58
332 changed files with 26337 additions and 21977 deletions

View File

@@ -93,7 +93,10 @@ class ContentTranslation
$content = $this->content;
// merge with the default content
if ($this->isDefault() === false && $defaultLanguage = $parent->kirby()->defaultLanguage()) {
if (
$this->isDefault() === false &&
$defaultLanguage = $parent->kirby()->defaultLanguage()
) {
$default = [];
if ($defaultTranslation = $parent->translation($defaultLanguage->code())) {
@@ -118,12 +121,11 @@ class ContentTranslation
/**
* Checks if the translation file exists
*
* @return bool
*/
public function exists(): bool
{
return file_exists($this->contentFile()) === true;
return empty($this->content) === false ||
file_exists($this->contentFile()) === true;
}
/**
@@ -211,7 +213,7 @@ class ContentTranslation
*
* @return string|null
*/
public function slug(): ?string
public function slug(): string|null
{
return $this->slug ??= ($this->content()['slug'] ?? null);
}