From f8d9c2cee0d7e9c1f1d68afb09035a98963fa036 Mon Sep 17 00:00:00 2001 From: Daniel Wehner Date: Mon, 14 Nov 2011 21:45:49 +0100 Subject: [PATCH] #1330716 by dereine: Take sure that using a view via views_get_current_view doesn't break the site. If it's empty throw some helpful debugging message --- includes/handlers.inc | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/includes/handlers.inc b/includes/handlers.inc index 6eddc4e..7ac431c 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(); + $replacements = array(); + if (!empty($view)) { + $replacements = $view->substitutions(); + } + else { + vpr('The current view is not set, maybe some code missed to execute $view->pre_execute()'); + } // Tack on the extra. if (isset($this->extra)) { -- 1.7.4.1