mirror of
https://github.com/grocy/grocy.git
synced 2025-08-08 23:29:43 +00:00
Fixed recipes page when there are no recipes
This commit is contained in:
parent
0134535a5e
commit
4c399392eb
@ -72,7 +72,15 @@ class RecipesController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$selectedRecipePositionsResolved = null;
|
||||||
|
$totalCosts = null;
|
||||||
|
$totalCalories = null;
|
||||||
|
if ($selectedRecipe)
|
||||||
|
{
|
||||||
$selectedRecipePositionsResolved = $this->getDatabase()->recipes_pos_resolved()->where('recipe_id = :1 AND is_nested_recipe_pos = 0', $selectedRecipe->id)->orderBy('ingredient_group', 'ASC', 'product_group', 'ASC');
|
$selectedRecipePositionsResolved = $this->getDatabase()->recipes_pos_resolved()->where('recipe_id = :1 AND is_nested_recipe_pos = 0', $selectedRecipe->id)->orderBy('ingredient_group', 'ASC', 'product_group', 'ASC');
|
||||||
|
$totalCosts = FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $selectedRecipe->id)->costs;
|
||||||
|
$totalCalories = FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $selectedRecipe->id)->calories;
|
||||||
|
}
|
||||||
|
|
||||||
$renderArray = [
|
$renderArray = [
|
||||||
'recipes' => $recipes,
|
'recipes' => $recipes,
|
||||||
@ -85,8 +93,8 @@ class RecipesController extends BaseController
|
|||||||
'userfields' => $this->getUserfieldsService()->GetFields('recipes'),
|
'userfields' => $this->getUserfieldsService()->GetFields('recipes'),
|
||||||
'userfieldValues' => $this->getUserfieldsService()->GetAllValues('recipes'),
|
'userfieldValues' => $this->getUserfieldsService()->GetAllValues('recipes'),
|
||||||
'quantityUnitConversionsResolved' => $this->getDatabase()->quantity_unit_conversions_resolved(),
|
'quantityUnitConversionsResolved' => $this->getDatabase()->quantity_unit_conversions_resolved(),
|
||||||
'selectedRecipeTotalCosts' => FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $selectedRecipe->id)->costs,
|
'selectedRecipeTotalCosts' => $totalCosts,
|
||||||
'selectedRecipeTotalCalories' => FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $selectedRecipe->id)->calories
|
'selectedRecipeTotalCalories' => $totalCalories
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($selectedRecipe)
|
if ($selectedRecipe)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user