Only reference unique areas in post-grazing observation logs.

This commit is contained in:
paul121 2020-10-27 13:58:34 -07:00 committed by Michael Stenta
parent 46a791f163
commit 3a2c2f9043
1 changed files with 3 additions and 0 deletions

View File

@ -631,6 +631,9 @@ function farm_livestock_move_form_submit($form, &$form_state) {
$previous_areas = array_merge($previous_areas, farm_movement_asset_location($asset));
}
// Remove any duplicate areas.
$previous_areas = array_unique($previous_areas, SORT_REGULAR);
// Link post grazing logs to the area(s) animals are moving from.
if (!empty($previous_areas)) {