Skip to content

Commit

Permalink
Merge branch '5.x' of https://github.com/spicywebau/craft-neo into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ttempleton committed Jun 26, 2024
2 parents 8f2c047 + 472d022 commit a24d9c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
- Removed the `neoblocks_owners` table; the Craft 5 `elements_owners` table is used instead
- Removed the `neoblocks.deletedWithOwner` column; the Craft 5 `elements.deletedWithOwner` column is used instead

## 4.2.5 - 2024-06-24

### Fixed
- Fixed a bug where content migrations that set Neo field values could fail to set more than one block in some cases

## 4.2.4 - 2024-06-18

### Fixed
Expand Down
9 changes: 7 additions & 2 deletions src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -1584,8 +1584,13 @@ private function _createBlocksFromSerializedData(array $value, ElementInterface
$baseBlockFieldNamespace .= '.blocks';
}
} else {
$newBlockData = $value;
$newSortOrder = array_keys($value);
$newBlockData = [];
$newSortOrder = [];

foreach ($value as $i => $blockData) {
$newBlockData["new$i"] = $blockData;
$newSortOrder[] = "new$i";
}
}

$blocks = [];
Expand Down

0 comments on commit a24d9c0

Please sign in to comment.