Upgrade to 3.2.5

This commit is contained in:
Bastian Allgeier
2019-09-24 11:00:59 +02:00
parent ff9b5b1861
commit 447a9dd266
234 changed files with 1990 additions and 1224 deletions

View File

@@ -23,7 +23,6 @@ use Kirby\Toolkit\Str;
*/
trait PageActions
{
/**
* Changes the sorting number
* The sorting number must already be correct
@@ -69,7 +68,7 @@ trait PageActions
* Changes the slug/uid of the page
*
* @param string $slug
* @param string $language
* @param string $languageCode
* @return self
*/
public function changeSlug(string $slug, string $languageCode = null)
@@ -101,13 +100,18 @@ trait PageActions
if ($oldPage->exists() === true) {
// remove the lock of the old page
$oldPage->lock()->remove();
if ($lock = $oldPage->lock()) {
$lock->remove();
}
// actually move stuff on disk
if (Dir::move($oldPage->root(), $newPage->root()) !== true) {
throw new LogicException('The page directory cannot be moved');
}
// remove from the siblings
$oldPage->parentModel()->children()->remove($oldPage);
Dir::remove($oldPage->mediaRoot());
}
@@ -126,7 +130,7 @@ trait PageActions
* Change the slug for a specific language
*
* @param string $slug
* @param string $language
* @param string $languageCode
* @return self
*/
protected function changeSlugForLanguage(string $slug, string $languageCode = null)
@@ -175,7 +179,7 @@ trait PageActions
protected function changeStatusToDraft()
{
$page = $this->commit('changeStatus', [$this, 'draft'], function ($page) {
$page = $this->commit('changeStatus', [$this, 'draft', null], function ($page) {
return $page->unpublish();
});
@@ -216,7 +220,7 @@ trait PageActions
return $this;
}
$page = $this->commit('changeStatus', [$this, 'unlisted'], function ($page) {
$page = $this->commit('changeStatus', [$this, 'unlisted', null], function ($page) {
return $page->publish()->changeNum(null);
});
@@ -295,7 +299,8 @@ trait PageActions
* 5. returns the result
*
* @param string $action
* @param mixed ...$arguments
* @param array $arguments
* @param Closure $callback
* @return mixed
*/
protected function commit(string $action, array $arguments, Closure $callback)
@@ -314,7 +319,7 @@ trait PageActions
* Copies the page to a new parent
*
* @param array $options
* @return Kirby\Cms\Page
* @return \Kirby\Cms\Page
*/
public function copy(array $options = [])
{
@@ -370,6 +375,13 @@ trait PageActions
}
}
// add copy to siblings
if ($isDraft === true) {
$parentModel->drafts()->append($copy->id(), $copy);
} else {
$parentModel->children()->append($copy->id(), $copy);
}
return $copy;
}
@@ -500,7 +512,7 @@ trait PageActions
'site' => $this->site(),
]);
return intval($template);
return (int)$template;
}
}
@@ -561,7 +573,7 @@ trait PageActions
*
* @param string $slug
* @param array $options
* @return Kirby\Cms\Page
* @return \Kirby\Cms\Page
*/
public function duplicate(string $slug = null, array $options = [])
{