Project:Recent Blocks
Version:4.7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

Original code enclosed in <Pp> and new code follows.

  /* <Pp> <N> make the query more ANSI, for compactibility with mySQL 5.x;
          otherwise: error: #1054 - Unknown column 'n.nid' in 'on clause'
          Help from: http://forums.mysql.com/read.php?104,111626,111626#msg-111626
    $sql = "SELECT n.nid, n.title, n.uid, n.changed, l.last_comment_timestamp, GREATEST(n.changed, l.last_comment_timestamp) AS last_change, l.comment_count".
            " FROM {node} n, {node_comment_statistics} l".
            " WHERE n.nid = l.nid AND $common_where AND $wow_comments".
            " ORDER BY $s[mode_full_sort] DESC";
           
     </Pp> */

    $sql = "SELECT n.nid, n.title, n.uid, n.changed, l.last_comment_timestamp, GREATEST(n.changed, l.last_comment_timestamp) AS last_change, l.comment_count".
            " FROM {node} AS n JOIN {node_comment_statistics} AS l ON n.nid = l.nid".
            " WHERE  $common_where AND $wow_comments".
            " ORDER BY $s[mode_full_sort] DESC";

Comments

#1

When relying on the kindness of a maintainer, it's a good idea to make his life easier by posting a proper patch . The process is outlined here and here. I'm not saying I won't fix it based on what you've posted, but an improper patch does make it less fun.