Skip to content

Commit

Permalink
Fix error that can occur if trying to bulkedit fields on a soft-delet…
Browse files Browse the repository at this point in the history
…ed layout
  • Loading branch information
Mosnar committed Feb 20, 2020
1 parent 1d1e0f8 commit a9013a6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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!!!
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/elements/processors/AssetProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions src/elements/processors/EntryProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a9013a6

Please sign in to comment.