diff --git a/includes/handlers.inc b/includes/handlers.inc index 6eddc4e..e6da8e6 100644 --- a/includes/handlers.inc +++ b/includes/handlers.inc @@ -1621,7 +1621,13 @@ class views_join { $output = " $this->type JOIN $right_table $table[alias] ON $left_field = $table[alias].$this->field"; // Load query tokens replacements. $view = views_get_current_view(); - $replacements = $view->substitutions(); + if (!empty($view)) { + $replacements = $view->substitutions(); + } + else { + vpr('The current view is not set, maybe some code missed to execute $view->pre_execute'); + $replacements = array(); + } // Tack on the extra. if (isset($this->extra)) {