From 2c40b97b72e2a28898bb05010adea37f296cb4d1 Mon Sep 17 00:00:00 2001 From: paul121 Date: Fri, 22 May 2020 13:18:25 -0700 Subject: [PATCH] Display archived asset groups with archived label. --- .../farm_livestock_weight/farm_livestock_weight.module | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/farm/farm_livestock/farm_livestock_weight/farm_livestock_weight.module b/modules/farm/farm_livestock/farm_livestock_weight/farm_livestock_weight.module index e9f9d4560..12ec36bea 100644 --- a/modules/farm/farm_livestock/farm_livestock_weight/farm_livestock_weight.module +++ b/modules/farm/farm_livestock/farm_livestock_weight/farm_livestock_weight.module @@ -156,9 +156,6 @@ function farm_livestock_weight_group_report_form($form, &$form_state) { $query->entityCondition('bundle', 'group'); $query->propertyOrderBy('name', 'ASC'); - // Limit to non-archived groups. - $query->propertyCondition('archived', 0); - // Execute the query and build a list of options. $options = array(); $result = $query->execute(); @@ -168,7 +165,11 @@ function farm_livestock_weight_group_report_form($form, &$form_state) { if (!empty($groups)) { foreach ($groups as $group) { if (!empty($group->id)) { - $options[$group->id] = entity_label('farm_asset', $group); + $label = entity_label('farm_asset', $group); + if ($group->archived) { + $label = $label . ' (' . t('archived') . ')'; + } + $options[$group->id] = $label; } } }