Skip to content

Commit

Permalink
Merge pull request #1383 from craftcms/bugfix/1378-importing-nested-e…
Browse files Browse the repository at this point in the history
…lement-fields

fix for importing inner element fields
  • Loading branch information
angrybrad authored Nov 25, 2023
2 parents 2406c10 + 217501c commit 146e46b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/base/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ protected function populateElementFields($elementIds, $nodeKey = null)

// Arrayed content doesn't provide defaults because its unable to determine how many items it _should_ return
// This also checks if there was any data that corresponds on the same array index/level as our element
$value = Hash::get($fieldValue, $nodeKey, $default);
/** @phpstan-ignore-next-line */
$value = Hash::get($fieldValue, $nodeKey ?? $key, $default);

if ($value) {
$fieldData[$elementId][$fieldHandle] = $value;
Expand Down

0 comments on commit 146e46b

Please sign in to comment.