mirror of https://github.com/kcal-app/kcal.git
Only evaluate serving name in summary when serving is used
This commit is contained in:
parent
73022ac167
commit
905635c022
|
|
@ -187,11 +187,13 @@ class JournalEntryController extends Controller
|
||||||
// Update summary
|
// Update summary
|
||||||
$unit = $ingredient['unit'];
|
$unit = $ingredient['unit'];
|
||||||
if ($item instanceof Food) {
|
if ($item instanceof Food) {
|
||||||
if (empty($item->serving_unit) && empty($item->serving_unit_name)) {
|
if ($unit === 'serving') {
|
||||||
$unit = null;
|
if (empty($item->serving_unit) && empty($item->serving_unit_name)) {
|
||||||
}
|
$unit = null;
|
||||||
elseif (!empty($item->serving_unit_name)) {
|
}
|
||||||
$unit = $item->serving_unit_formatted;
|
elseif (!empty($item->serving_unit_name)) {
|
||||||
|
$unit = $item->serving_unit_formatted;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$entries[$entry_key]->summary .= (!empty($entries[$entry_key]->summary) ? ', ' : null);
|
$entries[$entry_key]->summary .= (!empty($entries[$entry_key]->summary) ? ', ' : null);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue