Upgrade Kirby from 4.3.0 to 4.4.0

This commit is contained in:
Timothée Goguely 2024-09-12 17:37:56 +02:00
parent 03905dbd83
commit 3bed01af75
293 changed files with 54254 additions and 187 deletions

View file

@ -12,6 +12,7 @@ use Kirby\Cms\Site;
use Kirby\Cms\User;
use Kirby\Exception\InvalidArgumentException;
use Kirby\Exception\LogicException;
use Kirby\Exception\NotFoundException;
use Kirby\Toolkit\Str;
/**
@ -217,7 +218,13 @@ abstract class Uuid
return (static::$generator)($length);
}
if (App::instance()->option('content.uuid') === 'uuid-v4') {
$option = App::instance()->option('content.uuid');
if (is_array($option) === true) {
$option = $option['format'] ?? null;
}
if ($option === 'uuid-v4') {
return Str::uuid();
}
@ -332,6 +339,10 @@ abstract class Uuid
}
if ($lazy === false) {
if (App::instance()->option('content.uuid.index') === false) {
throw new NotFoundException('Model for UUID ' . $this->uri->toString() . ' could not be found without searching in the site index');
}
if ($this->model = $this->findByIndex()) {
// lazily fill cache by writing to cache
// whenever looked up from index to speed