mirror of
https://github.com/grocy/grocy.git
synced 2026-04-06 21:06:15 +02:00
Fix "Trying to access property barcodes on non-object" in productpicker
This commit is contained in:
parent
e9d6725f8a
commit
614e335091
|
|
@ -35,7 +35,12 @@
|
|||
data-target="@productpicker">
|
||||
<option value=""></option>
|
||||
@foreach($products as $product)
|
||||
<option data-additional-searchdata="{{ FindObjectInArrayByPropertyValue($barcodes, 'product_id', $product->id)->barcodes }},"
|
||||
@php $bc = null;
|
||||
if(isset($barcodes)) {
|
||||
$bc = FindObjectInArrayByPropertyValue($barcodes, 'product_id', $product->id);
|
||||
}
|
||||
@endphp
|
||||
<option data-additional-searchdata="@if(isset($bc)){{ $bc->barcodes }}@endif,"
|
||||
value="{{ $product->id }}">{{ $product->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user