Skip to content

Commit

Permalink
fix: also support nested browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofandel committed Feb 28, 2024
1 parent 42dd0b6 commit 446a772
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Repositories/Behaviors/HandleRepeaters.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,12 @@ function ($files, $role) use ($locale, $relation, $relationItem) {
foreach ($relatedItemFormFields['blocks'] ?? [] as $key => $block) {
$fields['blocks'][str_contains($key, '|') ? $key : "blocks-$relation-{$relationItem->id}|$key"] = $block;

Check warning on line 496 in src/Repositories/Behaviors/HandleRepeaters.php

View check run for this annotation

Codecov / codecov/patch

src/Repositories/Behaviors/HandleRepeaters.php#L495-L496

Added lines #L495 - L496 were not covered by tests
}
$fields['blocksFields'] = array_merge($fields['blocksFields'] ?? [], $relatedItemFormFields['blocksFields'] ?? []);
if (!empty($relatedItemFormFields['blocksFields'])) {
$fields['blocksFields'] = array_merge($fields['blocksFields'] ?? [], $relatedItemFormFields['blocksFields']);

Check warning on line 499 in src/Repositories/Behaviors/HandleRepeaters.php

View check run for this annotation

Codecov / codecov/patch

src/Repositories/Behaviors/HandleRepeaters.php#L498-L499

Added lines #L498 - L499 were not covered by tests
}
if (!empty($relatedItemFormFields['blocksBrowsers'])) {
$fields['blocksBrowsers'] = array_merge($fields['blocksBrowsers'] ?? [], $relatedItemFormFields['blocksBrowsers']);

Check warning on line 502 in src/Repositories/Behaviors/HandleRepeaters.php

View check run for this annotation

Codecov / codecov/patch

src/Repositories/Behaviors/HandleRepeaters.php#L501-L502

Added lines #L501 - L502 were not covered by tests
}

if (isset($relatedItemFormFields['repeaters'])) {
foreach ($relatedItemFormFields['repeaters'] as $childRepeaterName => $childRepeaterItems) {
Expand Down

0 comments on commit 446a772

Please sign in to comment.