Skip to content

Commit

Permalink
Fix #179
Browse files Browse the repository at this point in the history
  • Loading branch information
ttempleton committed Jan 25, 2019
1 parent 4589660 commit 3b5ba1f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.1.7 - 2019-01-25
### Fixed
- Fixed issue where Neo blocks would not appear on duplicated entries

## 2.1.6 - 2019-01-24
### Fixed
- Fixed error when pasting or cloning blocks on single-site Craft installations
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "spicyweb/craft-neo",
"description": "A Matrix-like field type that uses existing fields",
"version": "2.1.6",
"version": "2.1.7",
"type": "craft-plugin",
"keywords": [
"cms",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "craft-neo",
"version": "2.1.6",
"version": "2.1.7",
"description": "A Matrix-like field type that uses existing fields",
"main": "webpack.config.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion src/services/Fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function saveValue(Field $field, ElementInterface $owner, bool $isNew)

$blockIds = [];

foreach ($blocks as $block)
foreach ($blocks as &$block)
{
if ($duplicateBlocks)
{
Expand All @@ -251,6 +251,8 @@ public function saveValue(Field $field, ElementInterface $owner, bool $isNew)
$blockIds[] = $block->id;
}

unset($block);

// Now find any blocks that need to be deleted
// The blocks need to be returned in reverse order, as trying to delete them in regular order can
// cause a level-related SQL error
Expand Down

0 comments on commit 3b5ba1f

Please sign in to comment.