? nbproject
Index: include/views_handler_field_node_disqus_comments.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/disqus/include/Attic/views_handler_field_node_disqus_comments.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 views_handler_field_node_disqus_comments.inc
--- include/views_handler_field_node_disqus_comments.inc	19 Mar 2010 11:08:20 -0000	1.1.2.1
+++ include/views_handler_field_node_disqus_comments.inc	17 Aug 2010 09:13:32 -0000
@@ -3,20 +3,27 @@
 * Field handler to present the number of Disqus comments on a node.
 */
 class views_handler_field_node_disqus_comments extends views_handler_field {
+  function construct() {
+    parent::construct();
+    $this->additional_fields['nid'] = 'nid';
+  }
+
   function init(&$view, $options) {
     parent::init($view, $options);
   }
 
   function query() {
-    // Override parent::query() without altering query.
+    $this->ensure_my_table();
+    $this->add_additional_fields();
   }
 
   /**
    * When rendering the field.
    */
   function render($values) {
-    // Ensure Disqus comments are available on the node user has access to edit this node.
-    $node = node_load($values->nid);
+    $node = node_load($values->{$this->aliases['nid']});
+    // Ensure Disqus comments are available on the node and that the user has
+    // access to view them.
     if (user_access('view disqus comments') && isset($node->disqus)) {
       return theme('disqus_comments_num', $node->disqus['domain'], $node->disqus['url']);
     }
