If only a single log was returned, wrap it in an array.

This commit is contained in:
Michael Stenta 2020-08-27 08:33:39 -04:00
parent 6631de0530
commit e007fecc61
1 changed files with 5 additions and 0 deletions

View File

@ -54,6 +54,11 @@ function farm_livestock_weight_all($asset) {
// Load the logs with a 'weight' quantity measurement for this asset.
$logs = farm_quantity_log_asset($asset, 'weight', NULL, REQUEST_TIME, TRUE, 'farm_observation', FALSE);
// If only a single log was returned, wrap it in an array.
if (!is_array($logs)) {
$logs = array($logs);
}
// Start array of log weights.
$log_weights = array();