mirror of
https://github.com/grocy/grocy.git
synced 2026-04-08 13:46:14 +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">
|
data-target="@productpicker">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
@foreach($products as $product)
|
@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>
|
value="{{ $product->id }}">{{ $product->name }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user