diff --git a/CHANGELOG.md b/CHANGELOG.md index 6659717..8554501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Bulk Edit Changelog +## 2.0.2.1 - 2020-02-20 +### Fixed +- Error that can occur if trying to bulkedit fields on a soft-deleted layout + ## 2.0.2 - 2020-02-20 ### Added - All field types (including custom ones and Matrix) now support bulk replacement!!! diff --git a/composer.json b/composer.json index 0a1f2ec..f69620e 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "venveo/craft-bulkedit", "description": "Bulk edit entries", "type": "craft-plugin", - "version": "2.0.2", + "version": "2.0.2.1", "keywords": [ "craft", "cms", diff --git a/src/elements/processors/AssetProcessor.php b/src/elements/processors/AssetProcessor.php index af7d0d3..c3f9d98 100644 --- a/src/elements/processors/AssetProcessor.php +++ b/src/elements/processors/AssetProcessor.php @@ -30,7 +30,7 @@ public static function getLayoutsFromElementIds($elementIds): array ->all(); $groupIds = ArrayHelper::getColumn($groups, 'volumeId'); - $layouts = FieldLayout::find()->where(['in', 'id', $groupIds])->all(); + $layouts = FieldLayout::find()->where(['in', 'id', $groupIds])->andWhere(['=','dateDeleted', null])->all(); return $layouts; } diff --git a/src/elements/processors/EntryProcessor.php b/src/elements/processors/EntryProcessor.php index a49db5c..a5232b0 100644 --- a/src/elements/processors/EntryProcessor.php +++ b/src/elements/processors/EntryProcessor.php @@ -28,6 +28,7 @@ public static function getLayoutsFromElementIds($elementIds): array ->from('{{%fieldlayouts}} fieldlayouts') ->leftJoin('{{%elements}} elements', '[[elements.fieldLayoutId]] = [[fieldlayouts.id]]') ->where(['IN', '[[elements.id]]', $elementIds]) + ->andWhere(['=','fieldlayouts.dateDeleted', null]) ->all(); return $layouts;