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:
parent
28c22be933
commit
835137d0f3
1 changed files with 3 additions and 1 deletions
|
@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue