3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

Only include quantity fields in the template if they are not empty.

This commit is contained in:
Michael Stenta 2021-03-11 08:34:36 -05:00
parent 28c22be933
commit 835137d0f3

View file

@ -152,6 +152,8 @@ function template_preprocess_quantity(array &$variables) {
$variables['quantity'] = $variables['elements']['#quantity'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
if (!empty($variables['elements'][$key]['#items'])) {
$variables['content'][$key] = $variables['elements'][$key];
}
}
}