diff --git plugins/views_plugin_query_default.inc plugins/views_plugin_query_default.inc
index 86db672..ed7de83 100644
--- plugins/views_plugin_query_default.inc
+++ plugins/views_plugin_query_default.inc
@@ -1243,6 +1243,9 @@ class views_plugin_query_default extends views_plugin_query {
       $this->set_distinct();
     }
 
+    // Store the view in the object to be able to use it later.
+    $this->view = $view;
+
     $view->init_pager();
 
     // Let the pager modify the query to add limits.
