Skip to content

Commit

Permalink
Noclone flag (#706)
Browse files Browse the repository at this point in the history
* testing no clone

* fix issue with logger

* changelog
  • Loading branch information
nadar authored Feb 22, 2022
1 parent e49978a commit 2b1a814
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
7 changes: 7 additions & 0 deletions src/models/NgrestLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ public static function tableName()
return '{{%admin_ngrest_log}}';
}

public function init()
{
parent::init();

$this->detachBehavior('LogBehavior');
}

public function behaviors()
{
return [
Expand Down
4 changes: 3 additions & 1 deletion src/models/StorageFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ public function init()
public function behaviors()
{
return [
LogBehavior::class,
'LogBehavior' => [
'class' => LogBehavior::class,
],
[
'class' => TimestampBehavior::class,
'createdAtAttribute' => 'upload_timestamp',
Expand Down
3 changes: 2 additions & 1 deletion src/models/StorageFilterChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions src/models/StorageFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ public static function find()
{
return parent::find()->orderBy(['name' => 'ASC']);
}

/**
* @inheritdoc
*/
public function behaviors()
{
return [
LogBehavior::class,
];
}

/**
* @inheritdoc
Expand Down

0 comments on commit 2b1a814

Please sign in to comment.