diff --git a/CHANGELOG.md b/CHANGELOG.md index 726f4ae63..267abb2bb 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE + [#705](https://github.com/luyadev/luya-module-admin/pull/705) Fix issue with SelectArrayGently when using a closure + Changed default queueFiltersList to medium-thumbnail instead of meidum-cop ++ [#706](https://github.com/luyadev/luya-module-admin/pull/706) Use `ImageInterface::THUMBNAIL_FLAG_NOCLONE` when creating thumbnails and fix issue with ngrest logger when uploading files. ## 4.3.0 (15. February 2022) diff --git a/src/models/NgrestLog.php b/src/models/NgrestLog.php index 9794c5e13..569de9d6d 100644 --- a/src/models/NgrestLog.php +++ b/src/models/NgrestLog.php @@ -40,6 +40,13 @@ public static function tableName() return '{{%admin_ngrest_log}}'; } + public function init() + { + parent::init(); + + $this->detachBehavior('LogBehavior'); + } + public function behaviors() { return [ diff --git a/src/models/StorageFile.php b/src/models/StorageFile.php index 4479cabaf..2806d538f 100644 --- a/src/models/StorageFile.php +++ b/src/models/StorageFile.php @@ -73,7 +73,9 @@ public function init() public function behaviors() { return [ - LogBehavior::class, + 'LogBehavior' => [ + 'class' => LogBehavior::class, + ], [ 'class' => TimestampBehavior::class, 'createdAtAttribute' => 'upload_timestamp', diff --git a/src/models/StorageFilterChain.php b/src/models/StorageFilterChain.php index a9436a235..2b6c370df 100644 --- a/src/models/StorageFilterChain.php +++ b/src/models/StorageFilterChain.php @@ -9,6 +9,7 @@ use yii\db\ActiveRecord; use luya\admin\base\FilterInterface; use Imagine\Image\ManipulatorInterface; +use Yii; /** * Contains all information about filter effects for a single Chain element (like: thumbnail, 200x200). @@ -134,7 +135,7 @@ public function applyFilter(ImageInterface $image, array $saveOptions) return [$image, $this->effectChainValue($imagineEffectName, 'saveOptions')]; } elseif ($imagineEffectName == FilterInterface::EFFECT_THUMBNAIL) { // thumbnail - $image = Image::thumbnail($image, $this->effectChainValue($imagineEffectName, 'width'), $this->effectChainValue($imagineEffectName, 'height'), $this->effectChainValue($imagineEffectName, 'mode')); + $image = Image::thumbnail($image, $this->effectChainValue($imagineEffectName, 'width'), $this->effectChainValue($imagineEffectName, 'height'), $this->effectChainValue($imagineEffectName, 'mode') | ImageInterface::THUMBNAIL_FLAG_NOCLONE); return [$image, $this->effectChainValue($imagineEffectName, 'saveOptions')]; } elseif ($imagineEffectName == FilterInterface::EFFECT_WATERMARK) { // watermark diff --git a/src/models/StorageFolder.php b/src/models/StorageFolder.php index 87dd8806f..ef44c8abc 100644 --- a/src/models/StorageFolder.php +++ b/src/models/StorageFolder.php @@ -34,16 +34,6 @@ public static function find() { return parent::find()->orderBy(['name' => 'ASC']); } - - /** - * @inheritdoc - */ - public function behaviors() - { - return [ - LogBehavior::class, - ]; - } /** * @inheritdoc