mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Don't crash the recipes page when the amount contains user-desired (and manually edited) bullshit (fixes #1691)
This commit is contained in:
parent
ae5fad290f
commit
789e6a5291
@ -174,6 +174,15 @@
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
// The amount can't be non-numeric when using the frontend,
|
||||
// but some users decide to edit the database manually and
|
||||
// enter something like "4 or 5" in the amount column (brilliant)
|
||||
// => So at least don't crash this view by just assuming 0 if that's the case
|
||||
if (!is_numeric($recipePosition->amount))
|
||||
{
|
||||
$recipePosition->amount = 0;
|
||||
}
|
||||
|
||||
$product = FindObjectInArrayByPropertyValue($products, 'id', $recipePosition->product_id);
|
||||
$productQuConversions = FindAllObjectsInArrayByPropertyValue($quantityUnitConversionsResolved, 'product_id', $product->id);
|
||||
$productQuConversions = FindAllObjectsInArrayByPropertyValue($productQuConversions, 'from_qu_id', $product->qu_id_stock);
|
||||
|
Loading…
x
Reference in New Issue
Block a user