To simulate the bug:
Click menu 'My Subscriptions'
Click on 'Rss fee' tab
Displays the rss xml
Click back button on browser
Now click on any of the other tabs in my subscription (threads, categories, content type)
You get:
user warning: Invalid use of group function query: SELECT n.nid FROM node n LEFT JOIN term_node tn ON n.nid=tn.nid GROUP BY n.nid ORDER BY MAX(n.created) DESC LIMIT 0, 10 in /home/test/public_html/sandbox/includes/database.mysql.inc on line 120.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | subscriptions.module-diff-2006-09-18-15-31-07.patch | 1.1 KB | sanduhrs |
Comments
Comment #1
drupalzack commentedFresh installation of 4.7.2 and subscriptions module (tried both cvs and reg).
One thing you have to do is to enable 'my subscription' menu in the nav block and use that and not the one that's under my account/subscription.
Tried with/without clean url. Same error. But if I click on the tab again, it goes away. but each time I click on the feed icon and then on one of the subscription tabs, I get this error. Clicking the same tab again and the error goes away.
Comment #2
drupalzack commentedDigging some more, this is definitely a bug in mysql 4.x but not 5.x.
The patch is
$sql = "SELECT n.nid, max( n.created ) AS nc FROM {node} n LEFT JOIN {term_node} tn ON n.nid=tn.nid";
if ($cond) {
$sql.= " WHERE ". implode(' OR ', $cond);
}
$sql .= " GROUP BY n.nid ORDER BY nc DESC";
$result = db_query_range(db_rewrite_sql($sql), 0, variable_get('feed_default_items', 10));
$channel['title'] = t("%name Subscriptions", array('%name' => $account->name));
$channel['link'] = url("subscriptions/feed", NULL, NULL, TRUE);
// $channel['description'] = ;
node_feed($result, $channel);
at the end of subscription.module. Note alias for the order by clause. Mysql 4.x cannot parse that without an error. Mysql 5.0 is fine with it.
Thanks
Comment #3
sanduhrsI can confirm this bug.
The provided solution seems to work, so here the patch.
Comment #4
moshe weitzman commentedbug is confirmed by me too. haven't tested patch.
Comment #5
dziemecki commentedPlease do test the patch. I'm running Drupal 4.7 on PHP 4.x, and I can't dupe the error.
Comment #6
JHeffner commentedI had the same error in my logs with incorrect feed information being included in the rss feed as well. I applied the patch and it resolves the issue for me.
Drupal 4.7.3 w/ PHP 4.3.9
Comment #7
lmw94002 commentedWith: Drupal 4.7.4, MySQL 4.1.11 & PHP 5.0.4
I experienced the error. The patch above did seem to successfully correct the issue for my installation.
Comment #8
dziemecki commentedCorrected code committed.
Comment #9
(not verified) commented