Upgrade to 3.6.0

This commit is contained in:
Bastian Allgeier
2021-11-16 14:53:37 +01:00
parent 7388fa4d24
commit 92b7a330fa
318 changed files with 20017 additions and 6878 deletions

View File

@@ -5,7 +5,7 @@ namespace Kirby\Cms;
use Kirby\Exception\InvalidArgumentException;
/**
* Resizing, blurring etc.
* Trait for image resizing, blurring etc.
*
* @package Kirby Cms
* @author Bastian Allgeier <bastian@getkirby.com>
@@ -191,9 +191,20 @@ trait FileModifications
return $this;
}
$result = ($this->kirby()->component('file::version'))($this->kirby(), $this, $options);
// fallback to global config options
if (isset($options['format']) === false) {
if ($format = $this->kirby()->option('thumbs.format')) {
$options['format'] = $format;
}
}
if (is_a($result, 'Kirby\Cms\FileVersion') === false && is_a($result, 'Kirby\Cms\File') === false) {
$component = $this->kirby()->component('file::version');
$result = $component($this->kirby(), $this, $options);
if (
is_a($result, 'Kirby\Cms\FileVersion') === false &&
is_a($result, 'Kirby\Cms\File') === false
) {
throw new InvalidArgumentException('The file::version component must return a File or FileVersion object');
}