Upgrade to 3.8.1

This commit is contained in:
Bastian Allgeier
2022-10-18 14:11:15 +02:00
parent 94b2a32baf
commit 9c93e01c3a
71 changed files with 633 additions and 5705 deletions

View File

@@ -8,6 +8,7 @@ use Kirby\Exception\LogicException;
use Kirby\Filesystem\F;
use Kirby\Form\Form;
use Kirby\Uuid\Uuid;
use Kirby\Uuid\Uuids;
/**
* FileActions
@@ -155,7 +156,9 @@ trait FileActions
$copy = $page->clone()->file($this->filename());
// overwrite with new UUID (remove old, add new)
$copy = $copy->save(['uuid' => Uuid::generate()]);
if (Uuids::enabled() === true) {
$copy = $copy->save(['uuid' => Uuid::generate()]);
}
return $copy;
}
@@ -191,7 +194,9 @@ trait FileActions
// make sure that a UUID gets generated and
// added to content right away
$content['uuid'] = Uuid::generate();
if (Uuids::enabled() === true) {
$content['uuid'] ??= Uuid::generate();
}
// create a form for the file
$form = Form::for($file, ['values' => $content]);
@@ -336,7 +341,7 @@ trait FileActions
$this->lock()?->remove();
// clear UUID cache
$this->uuid()->clear();
$this->uuid()?->clear();
}
return $this;