Skip to content

Commit 09196dc

Browse files
committed
fix(loot): use default $recipient value when $loot->rewardable_recipient is nonexistent
1 parent 355ba85 commit 09196dc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

resources/views/widgets/_loot_select.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<tr class="loot-row">
7878
@if ($showRecipient)
7979
<td>
80-
{!! Form::select($prefix . 'rewardable_recipient[]', $rewardableRecipients, $loot->rewardable_recipient, [
80+
{!! Form::select($prefix . 'rewardable_recipient[]', $rewardableRecipients, $loot->rewardable_recipient ?? $recipient, [
8181
'class' => 'form-control recipient-type',
8282
'placeholder' => 'Select Recipient Type',
8383
]) !!}
@@ -86,14 +86,14 @@
8686

8787
<td class="{{ $prefix }}loot-row-type">
8888
{{-- The long array of key value pairs is now defined in getRewardTypes and data should be moved there --}}
89-
{!! Form::select($prefix . 'rewardable_type[]', getRewardTypes($showData, $loot->rewardable_recipient), $loot->rewardable_type, [
89+
{!! Form::select($prefix . 'rewardable_type[]', getRewardTypes($showData, $loot->rewardable_recipient ?? $recipient), $loot->rewardable_type, [
9090
'class' => 'form-control reward-type',
9191
'placeholder' => 'Select ' . $type . ' Type',
9292
]) !!}
9393
</td>
9494
<td class="{{ $prefix }}loot-row-select">
9595
{{-- If statements here can be removed and replaced with the below code. They are now defined programmatically --}}
96-
{!! Form::select($prefix . 'rewardable_id[]', $showRecipient ? $rewardLootData[$loot->rewardable_recipient][$loot->rewardable_type] : $rewardLootData[$loot->rewardable_type], $loot->rewardable_id, [
96+
{!! Form::select($prefix . 'rewardable_id[]', $showRecipient ? $rewardLootData[$loot->rewardable_recipient ?? $recipient][$loot->rewardable_type] : $rewardLootData[$loot->rewardable_type], $loot->rewardable_id, [
9797
'class' => 'form-control ' . strtolower($loot->rewardable_type) . '-select',
9898
'placeholder' => 'Select ' . $rewardTypes[$loot->rewardable_type],
9999
]) !!}

0 commit comments

Comments
 (0)