From c12fe49d07bd09824f1d40f0b43cf183d9fbb978 Mon Sep 17 00:00:00 2001
From: Earl Miles <merlin@logrus.com>
Date: Sun, 16 Mar 2008 01:36:34 +0000
Subject: [PATCH] Miscellaneous minor fixes, including fixing the uid and nid
 argument titles

---
 includes/admin.inc     | 2 ++
 modules/node.views.inc | 2 +-
 modules/user.views.inc | 4 ++--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/includes/admin.inc b/includes/admin.inc
index 2c6c98905..730c13cee 100644
--- a/includes/admin.inc
+++ b/includes/admin.inc
@@ -111,6 +111,8 @@ function views_ui_preview($js, $view) {
     $args = explode('/', $form_state['args']);
   }
 
+  // Fix 'q' for paging so that it will go to the NON ajax live preview.
+  $_GET['q'] = str_replace('ajax', 'nojs', $_GET['q']);
   $preview = $view->preview($form_state['display_id'], $args);
 
   $output .= '<div class="views-query-info">';
diff --git a/modules/node.views.inc b/modules/node.views.inc
index b0bc8cf42..996c42875 100644
--- a/modules/node.views.inc
+++ b/modules/node.views.inc
@@ -359,7 +359,7 @@ class views_handler_argument_node_nid extends views_handler_argument {
    * Override the behavior of title(). Get the title of the node.
    */
   function title() {
-    $title = db_result(db_query(db_rewrite_sql("SELECT n.title FROM {node} n WHERE n.nid = %d"), $this->argument));
+    $title = db_result(db_query(db_rewrite_sql("SELECT n.title FROM {node} n WHERE n.nid = %d", $this->argument)));
     if (empty($title)) {
       return t('No title');
     }
diff --git a/modules/user.views.inc b/modules/user.views.inc
index b1c1acf4b..305d34715 100644
--- a/modules/user.views.inc
+++ b/modules/user.views.inc
@@ -152,10 +152,10 @@ class views_handler_argument_user_uid extends views_handler_argument {
       $title = variable_get('anonymous', t('Anonymous'));
     }
     else {
-      $title = db_result(db_query("SELECT u.title FROM {user} u WHERE u.uid = %d"), $this->argument);
+      $title = db_result(db_query("SELECT u.name FROM {users} u WHERE u.uid = %d", $this->argument));
     }
     if (empty($title)) {
-      return t('No title');
+      return t('No user');
     }
 
     return check_plain($title);
-- 
GitLab