Upgrade to 3.7.3

This commit is contained in:
Bastian Allgeier
2022-08-10 12:18:04 +02:00
parent fbb8023da4
commit 281090cd87
9 changed files with 125 additions and 83 deletions

View File

@@ -3,7 +3,7 @@
"description": "The Kirby 3 core", "description": "The Kirby 3 core",
"license": "proprietary", "license": "proprietary",
"type": "kirby-cms", "type": "kirby-cms",
"version": "3.7.2.1", "version": "3.7.3",
"keywords": [ "keywords": [
"kirby", "kirby",
"cms", "cms",

2
kirby/composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "4819e4aa2dee49d448384cab2a1ea69d", "content-hash": "827f8a5e963d3abf77541dcaf04432e6",
"packages": [ "packages": [
{ {
"name": "claviska/simpleimage", "name": "claviska/simpleimage",

View File

@@ -96,10 +96,18 @@ return [
'methods' => [ 'methods' => [
'columnsValues' => function (array $item, $model) { 'columnsValues' => function (array $item, $model) {
$item['title'] = [ $item['title'] = [
'text' => $item['text'], // override toSafeString() coming from `$item`
// because the table cells don't use v-html
'text' => $model->toString($this->text),
'href' => $model->panel()->url(true) 'href' => $model->panel()->url(true)
]; ];
if ($this->info) {
// override toSafeString() coming from `$item`
// because the table cells don't use v-html
$item['info'] = $model->toString($this->info);
}
foreach ($this->columns as $columnName => $column) { foreach ($this->columns as $columnName => $column) {
// don't overwrite essential columns // don't overwrite essential columns
if (isset($item[$columnName]) === true) { if (isset($item[$columnName]) === true) {
@@ -107,11 +115,7 @@ return [
} }
if (empty($column['value']) === false) { if (empty($column['value']) === false) {
if ($column['type'] ?? false === 'html') { $value = $model->toString($column['value']);
$value = $model->toString($column['value']);
} else {
$value = $model->toSafeString($column['value']);
}
} else { } else {
$value = $model->content()->get($column['id'] ?? $columnName)->value(); $value = $model->content()->get($column['id'] ?? $columnName)->value();
} }

View File

@@ -29,7 +29,7 @@
"days.tue": "\ud654", "days.tue": "\ud654",
"days.wed": "\uc218", "days.wed": "\uc218",
"debugging": "디버", "debugging": "디버",
"delete": "\uc0ad\uc81c", "delete": "\uc0ad\uc81c",
"delete.all": "모두 삭제", "delete.all": "모두 삭제",
@@ -49,8 +49,8 @@
"email": "\uc774\uba54\uc77c \uc8fc\uc18c", "email": "\uc774\uba54\uc77c \uc8fc\uc18c",
"email.placeholder": "mail@example.com", "email.placeholder": "mail@example.com",
"entries": "Entries", "entries": "항목",
"entry": "Entry", "entry": "항목",
"environment": "구동 환경", "environment": "구동 환경",
@@ -297,7 +297,7 @@
"hide": "숨기기", "hide": "숨기기",
"hour": "시", "hour": "시",
"import": "가져오기", "import": "가져오기",
"info": "Info", "info": "정보",
"insert": "\uc0bd\uc785", "insert": "\uc0bd\uc785",
"insert.after": "뒤에 삽입", "insert.after": "뒤에 삽입",
"insert.before": "앞에 삽입", "insert.before": "앞에 삽입",
@@ -306,15 +306,15 @@
"installation": "설치", "installation": "설치",
"installation.completed": "패널을 설치했습니다.", "installation.completed": "패널을 설치했습니다.",
"installation.disabled": "패널 설치 관리자는 로컬 서버에서 실행하거나 <code>panel.install</code> 옵션을 설정하세요.", "installation.disabled": "패널 설치 관리자는 로컬 서버에서 실행하거나 <code>panel.install</code> 옵션을 설정하세요.",
"installation.issues.accounts": "폴더(<code>/site/accounts</code>)에 쓰기 권한이 없습니다.", "installation.issues.accounts": "<code>/site/accounts</code> 폴더의 쓰기 권한을 확인하세요.",
"installation.issues.content": "폴더(<code>/content</code>)에 쓰기 권한이 없습니다.", "installation.issues.content": "<code>/content</code> 폴더의 쓰기 권한을 확인하세요.",
"installation.issues.curl": "<code>cURL</code> 확장 모듈이 필요합니다.", "installation.issues.curl": "<code>cURL</code> 확장 모듈이 필요합니다.",
"installation.issues.headline": "패널을 설치할 수 없습니다.", "installation.issues.headline": "패널을 설치할 수 없습니다.",
"installation.issues.mbstring": "<code>MB String</code> 확장 모듈이 필요합니다.", "installation.issues.mbstring": "<code>MB String</code> 확장 모듈이 필요합니다.",
"installation.issues.media": "폴더(<code>/media</code>)에 쓰기 권한이 없습니다.", "installation.issues.media": "<code>/media</code> 폴더의 쓰기 권한을 확인하세요.",
"installation.issues.php": "<code>PHP</code> 버전이 7 이상인지 확인하세요.", "installation.issues.php": "<code>PHP</code> 버전이 7 이상인지 확인하세요.",
"installation.issues.server": "Kirby를 실행하려면 <code>Apache</code>, <code>Nginx</code>, 또는 <code>Caddy</code>가 필요합니다.", "installation.issues.server": "Kirby를 실행하려면 <code>Apache</code>, <code>Nginx</code>, 또는 <code>Caddy</code>가 필요합니다.",
"installation.issues.sessions": "폴더(<code>/site/sessions</code>)에 쓰기 권한이 없습니다.", "installation.issues.sessions": "<code>/site/sessions</code> 폴더의 쓰기 권한을 확인하세요.",
"language": "\uc5b8\uc5b4", "language": "\uc5b8\uc5b4",
"language.code": "언어 코드", "language.code": "언어 코드",
@@ -327,7 +327,7 @@
"language.direction.ltr": "왼쪽에서 오른쪽", "language.direction.ltr": "왼쪽에서 오른쪽",
"language.direction.rtl": "오른쪽에서 왼쪽", "language.direction.rtl": "오른쪽에서 왼쪽",
"language.locale": "PHP 로캘 문자열", "language.locale": "PHP 로캘 문자열",
"language.locale.warning": "사용자 지정 로캘을 사용 중입니다. 폴더(<code>/site/languages</code>)의 언어 파일을 수정하세요.", "language.locale.warning": "사용자 지정 로캘을 사용 중입니다. <code>/site/languages</code> 폴더의 언어 파일을 수정하세요.",
"language.name": "언어명", "language.name": "언어명",
"language.updated": "언어를 변경했습니다.", "language.updated": "언어를 변경했습니다.",
@@ -340,12 +340,12 @@
"license": "라이선스", "license": "라이선스",
"license.buy": "라이선스 구매", "license.buy": "라이선스 구매",
"license.register": "등록", "license.register": "등록",
"license.manage": "Manage your licenses", "license.manage": "라이선스 관리",
"license.register.help": "Kirby를 등록하려면 이메일로 전송받은 라이선스 코드와 이메일 주소를 입력하세요.", "license.register.help": "Kirby를 등록하려면 이메일로 전송받은 라이선스 코드와 이메일 주소를 입력하세요.",
"license.register.label": "라이선스 코드를 입력하세요.", "license.register.label": "라이선스 코드를 입력하세요.",
"license.register.success": "Kirby와 함께해주셔서 감사합니다.", "license.register.success": "Kirby와 함께해주셔서 감사합니다.",
"license.unregistered": "Kirby가 등록되지 않았습니다.", "license.unregistered": "Kirby가 등록되지 않았습니다.",
"license.unregistered.label": "Unregistered", "license.unregistered.label": "Kirby가 등록되지 않았습니다.",
"link": "\uc77c\ubc18 \ub9c1\ud06c", "link": "\uc77c\ubc18 \ub9c1\ud06c",
"link.text": "\ubb38\uc790", "link.text": "\ubb38\uc790",
@@ -475,7 +475,7 @@
"section.required": "섹션이 필요합니다.", "section.required": "섹션이 필요합니다.",
"security": "Security", "security": "보안",
"select": "선택", "select": "선택",
"server": "서버", "server": "서버",
"settings": "설정", "settings": "설정",
@@ -485,13 +485,13 @@
"slug": "고유 주소", "slug": "고유 주소",
"sort": "정렬", "sort": "정렬",
"stats.empty": "No reports", "stats.empty": "관련 기록이 없습니다.",
"system.issues.content": "The content folder seems to be exposed", "system.issues.content": "<code>/content</code> 폴더의 권한을 확인하세요.",
"system.issues.debug": "최종 결과물에서는 디버 모드를 해제하세요.", "system.issues.debug": "공개 서버상에서는 디버 모드를 해제하세요.",
"system.issues.git": "The .git folder seems to be exposed", "system.issues.git": "<code>/.git</code> 폴더의 권한을 확인하세요.",
"system.issues.https": "모든 사이트에 HTTPS를 권장합니다.", "system.issues.https": "HTTPS를 권장합니다.",
"system.issues.kirby": "The kirby folder seems to be exposed", "system.issues.kirby": "<code>/kirby</code> 폴더의 권한을 확인하세요.",
"system.issues.site": "The site folder seems to be exposed", "system.issues.site": "<code>/site</code> 폴더의 권한을 확인하세요.",
"title": "제목", "title": "제목",
"template": "\ud15c\ud50c\ub9bf", "template": "\ud15c\ud50c\ub9bf",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -19,17 +19,25 @@ trait HasChildren
/** /**
* The list of available published children * The list of available published children
* *
* @var \Kirby\Cms\Pages * @var \Kirby\Cms\Pages|null
*/ */
public $children; public $children;
/** /**
* The list of available draft children * The list of available draft children
* *
* @var \Kirby\Cms\Pages * @var \Kirby\Cms\Pages|null
*/ */
public $drafts; public $drafts;
/**
* The combined list of available published
* and draft children
*
* @var \Kirby\Cms\Pages|null
*/
public $childrenAndDrafts;
/** /**
* Returns all published children * Returns all published children
* *
@@ -51,7 +59,11 @@ trait HasChildren
*/ */
public function childrenAndDrafts() public function childrenAndDrafts()
{ {
return $this->children()->merge($this->drafts()); if (is_a($this->childrenAndDrafts, 'Kirby\Cms\Pages') === true) {
return $this->childrenAndDrafts;
}
return $this->childrenAndDrafts = $this->children()->merge($this->drafts());
} }
/** /**

View File

@@ -66,10 +66,7 @@ trait PageActions
} }
// overwrite the child in the parent page // overwrite the child in the parent page
$newPage static::updateParentCollections($newPage, 'set');
->parentModel()
->children()
->set($newPage->id(), $newPage);
return $newPage; return $newPage;
}); });
@@ -123,17 +120,13 @@ trait PageActions
} }
// remove from the siblings // remove from the siblings
$oldPage->parentModel()->children()->remove($oldPage); static::updateParentCollections($oldPage, 'remove');
Dir::remove($oldPage->mediaRoot()); Dir::remove($oldPage->mediaRoot());
} }
// overwrite the new page in the parent collection // overwrite the new page in the parent collection
if ($newPage->isDraft() === true) { static::updateParentCollections($newPage, 'set');
$newPage->parentModel()->drafts()->set($newPage->id(), $newPage);
} else {
$newPage->parentModel()->children()->set($newPage->id(), $newPage);
}
return $newPage; return $newPage;
}); });
@@ -167,7 +160,12 @@ trait PageActions
$slug = null; $slug = null;
} }
return $page->save(['slug' => $slug], $languageCode); $newPage = $page->save(['slug' => $slug], $languageCode);
// overwrite the updated page in the parent collection
static::updateParentCollections($newPage, 'set');
return $newPage;
}); });
} }
@@ -319,11 +317,7 @@ trait PageActions
} }
// update the parent collection // update the parent collection
if ($page->isDraft() === true) { static::updateParentCollections($page, 'set');
$page->parentModel()->drafts()->set($page->id(), $page);
} else {
$page->parentModel()->children()->set($page->id(), $page);
}
return $page; return $page;
}); });
@@ -343,11 +337,7 @@ trait PageActions
$page = $page->save(['title' => $title], $languageCode); $page = $page->save(['title' => $title], $languageCode);
// flush the parent cache to get children and drafts right // flush the parent cache to get children and drafts right
if ($page->isDraft() === true) { static::updateParentCollections($page, 'set');
$page->parentModel()->drafts()->set($page->id(), $page);
} else {
$page->parentModel()->children()->set($page->id(), $page);
}
return $page; return $page;
}); });
@@ -457,11 +447,7 @@ trait PageActions
} }
// add copy to siblings // add copy to siblings
if ($isDraft === true) { static::updateParentCollections($copy, 'append', $parentModel);
$parentModel->drafts()->append($copy->id(), $copy);
} else {
$parentModel->children()->append($copy->id(), $copy);
}
return $copy; return $copy;
} }
@@ -504,11 +490,7 @@ trait PageActions
$page = $page->save($page->content()->toArray(), $languageCode); $page = $page->save($page->content()->toArray(), $languageCode);
// flush the parent cache to get children and drafts right // flush the parent cache to get children and drafts right
if ($page->isDraft() === true) { static::updateParentCollections($page, 'append');
$page->parentModel()->drafts()->append($page->id(), $page);
} else {
$page->parentModel()->children()->append($page->id(), $page);
}
return $page; return $page;
}); });
@@ -643,10 +625,9 @@ trait PageActions
} }
} }
if ($page->isDraft() === true) { static::updateParentCollections($page, 'remove');
$page->parentModel()->drafts()->remove($page);
} else { if ($page->isDraft() === false) {
$page->parentModel()->children()->remove($page);
$page->resortSiblingsAfterUnlisting(); $page->resortSiblingsAfterUnlisting();
} }
@@ -664,7 +645,6 @@ trait PageActions
*/ */
public function duplicate(string $slug = null, array $options = []) public function duplicate(string $slug = null, array $options = [])
{ {
// create the slug for the duplicate // create the slug for the duplicate
$slug = Str::slug($slug ?? $this->slug() . '-' . Str::slug(I18n::translate('page.duplicate.appendix'))); $slug = Str::slug($slug ?? $this->slug() . '-' . Str::slug(I18n::translate('page.duplicate.appendix')));
@@ -722,8 +702,14 @@ trait PageActions
} }
// remove the page from the parent drafts and add it to children // remove the page from the parent drafts and add it to children
$page->parentModel()->drafts()->remove($page); $parentModel = $page->parentModel();
$page->parentModel()->children()->append($page->id(), $page); $parentModel->drafts()->remove($page);
$parentModel->children()->append($page->id(), $page);
// update the childrenAndDrafts() cache if it is initialized
if ($parentModel->childrenAndDrafts !== null) {
$parentModel->childrenAndDrafts()->set($page->id(), $page);
}
return $page; return $page;
} }
@@ -734,13 +720,14 @@ trait PageActions
*/ */
public function purge() public function purge()
{ {
$this->blueprint = null; $this->blueprint = null;
$this->children = null; $this->children = null;
$this->content = null; $this->childrenAndDrafts = null;
$this->drafts = null; $this->content = null;
$this->files = null; $this->drafts = null;
$this->inventory = null; $this->files = null;
$this->translations = null; $this->inventory = null;
$this->translations = null;
return $this; return $this;
} }
@@ -788,6 +775,7 @@ trait PageActions
$parent = $this->parentModel(); $parent = $this->parentModel();
$parent->children = $parent->children()->sort('num', 'asc'); $parent->children = $parent->children()->sort('num', 'asc');
$parent->childrenAndDrafts = null;
return true; return true;
} }
@@ -812,6 +800,7 @@ trait PageActions
} }
$parent->children = $siblings->sort('num', 'asc'); $parent->children = $siblings->sort('num', 'asc');
$parent->childrenAndDrafts = null;
} }
return true; return true;
@@ -845,8 +834,14 @@ trait PageActions
} }
// remove the page from the parent children and add it to drafts // remove the page from the parent children and add it to drafts
$page->parentModel()->children()->remove($page); $parentModel = $page->parentModel();
$page->parentModel()->drafts()->append($page->id(), $page); $parentModel->children()->remove($page);
$parentModel->drafts()->append($page->id(), $page);
// update the childrenAndDrafts() cache if it is initialized
if ($parentModel->childrenAndDrafts !== null) {
$parentModel->childrenAndDrafts()->set($page->id(), $page);
}
$page->resortSiblingsAfterUnlisting(); $page->resortSiblingsAfterUnlisting();
@@ -874,6 +869,37 @@ trait PageActions
$page = $page->changeNum($page->createNum()); $page = $page->changeNum($page->createNum());
} }
// overwrite the updated page in the parent collection
static::updateParentCollections($page, 'set');
return $page; return $page;
} }
/**
* Updates parent collections with the new page object
* after a page action
*
* @param \Kirby\Cms\Page $page
* @param string $method Method to call on the parent collections
* @param \Kirby\Cms\Page|null $parentMdel
* @return void
*/
protected static function updateParentCollections($page, string $method, $parentModel = null): void
{
$parentModel ??= $page->parentModel();
// method arguments depending on the called method
$args = $method === 'remove' ? [$page] : [$page->id(), $page];
if ($page->isDraft() === true) {
$parentModel->drafts()->$method(...$args);
} else {
$parentModel->children()->$method(...$args);
}
// update the childrenAndDrafts() cache if it is initialized
if ($parentModel->childrenAndDrafts !== null) {
$parentModel->childrenAndDrafts()->$method(...$args);
}
}
} }

View File

@@ -1,8 +1,8 @@
<?php return array( <?php return array(
'root' => array( 'root' => array(
'name' => 'getkirby/cms', 'name' => 'getkirby/cms',
'pretty_version' => '3.7.2.1', 'pretty_version' => '3.7.3',
'version' => '3.7.2.1', 'version' => '3.7.3.0',
'reference' => NULL, 'reference' => NULL,
'type' => 'kirby-cms', 'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
@@ -29,8 +29,8 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'getkirby/cms' => array( 'getkirby/cms' => array(
'pretty_version' => '3.7.2.1', 'pretty_version' => '3.7.3',
'version' => '3.7.2.1', 'version' => '3.7.3.0',
'reference' => NULL, 'reference' => NULL,
'type' => 'kirby-cms', 'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',