--- theme.inc (saved version) +++ (current document) @@ -175,42 +175,44 @@ foreach ($columns as $field => $column) { $field_alias = $fields[$field]->field_alias; if ($field == $column && empty($fields[$field]->options['exclude'])) { - foreach ($$process as $num => $row) { - $type = ''; - foreach ($row as $item) { - if (in_array($item, array_keys(_views_calc_calc_options()))) { - $type = $item; - break; + if (is_array($$process)){ + foreach ($$process as $num => $row) { + $type = ''; + foreach ($row as $item) { + if (in_array($item, array_keys(_views_calc_calc_options()))) { + $type = $item; + break; + } } - } - if (!empty($row->$field_alias) || (isset($row->$field_alias) && $row->$field_alias === 0)) { + if (!empty($row->$field_alias) || (isset($row->$field_alias) && $row->$field_alias === 0)) { - // COUNT is always a numeric value, no matter what kind of field it is. - if ($type == 'COUNT') { - $vars[$process][$type][$column] = $row->$field_alias; - } - // Calculations other than COUNT should run the value through the field's theme. - // This will allow dates and numeric values to apply the right formatting to the result. - else { - $vars[$process][$type][$column] = $fields[$field]->theme($row); - } - } - elseif (!empty($type)) { - // Add the calc type label into the first empty column. - // Identify which is the sub total and which the grand total - // when both are provided. - if (empty($added_label[$type])) { - if ($process == 'sub_totals') { - $label = t("Page !Calculation", array("!Calculation" => $type)); + // COUNT is always a numeric value, no matter what kind of field it is. + if ($type == 'COUNT') { + $vars[$process][$type][$column] = $row->$field_alias; } + // Calculations other than COUNT should run the value through the field's theme. + // This will allow dates and numeric values to apply the right formatting to the result. else { - $label = t("Total !Calculation", array("!Calculation" => $type)); + $vars[$process][$type][$column] = $fields[$field]->theme($row); } - $vars[$process][$type][$column] = $label; - $added_label[$type] = TRUE; } - else { - $vars[$process][$type][$column] = ''; + elseif (!empty($type)) { + // Add the calc type label into the first empty column. + // Identify which is the sub total and which the grand total + // when both are provided. + if (empty($added_label[$type])) { + if ($process == 'sub_totals') { + $label = t("Page !Calculation", array("!Calculation" => $type)); + } + else { + $label = t("Total !Calculation", array("!Calculation" => $type)); + } + $vars[$process][$type][$column] = $label; + $added_label[$type] = TRUE; + } + else { + $vars[$process][$type][$column] = ''; + } } } }