Commit e27b96a5 authored by hass's avatar hass
Browse files

#1173778 E_ALL: Node object could be empty

parent 174c29a8
......@@ -187,8 +187,12 @@ function googleanalytics_page_alter(&$page) {
$custom_var_value = !empty($googleanalytics_custom_vars['slots'][$i]['value']) ? $googleanalytics_custom_vars['slots'][$i]['value'] : '';
$custom_var_scope = !empty($googleanalytics_custom_vars['slots'][$i]['scope']) ? $googleanalytics_custom_vars['slots'][$i]['scope'] : 3;
$types = array();
$node = menu_get_object();
$custom_var_value = token_replace($custom_var_value, array('node' => $node), array('clear' => TRUE));
if (is_object($node)) {
$types += array('node' => $node);
}
$custom_var_value = token_replace($custom_var_value, $types, array('clear' => TRUE));
// Suppress empty custom variables.
if (!is_numeric($custom_var_value) && empty($custom_var_value)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment