When I try to delete an Aggregator2 feed or feed-item I get an SQL ERROR as follows:
user error: Not unique table/alias: 'tn'
query: SELECT COUNT(*) FROM node n
INNER JOIN term_node tn ON n.nid = tn.nid
INNER JOIN term_node tn ON n.nid = tn.nid
INNER JOIN users u ON n.uid = u.uid
WHERE n.type = 'aggregator2-feed'
AND tn.tid = 2
AND n.type = 'aggregator2-item'
AND tn.tid = 2
in C:\Inetpub\wwwroot\tapenews000\includes\database.mysql.inc on line 66.
user error: Not unique table/alias: 'tn'
query: SELECT n.*, u.name, u.uid
FROM node n
INNER JOIN term_node tn ON n.nid = tn.nid
INNER JOIN term_node tn ON n.nid = tn.nid
INNER JOIN users u ON n.uid = u.uid
WHERE n.type = 'aggregator2-feed'
AND tn.tid = 2
AND n.type = 'aggregator2-item'
AND tn.tid = 2
ORDER BY n.changed
DESC LIMIT 0, 50
in C:\Inetpub\wwwroot\tapenews000\includes\database.mysql.inc on line 66.
Please note that in both cases the lines "INNER JOIN term_node ... etc" are concatenated with no space as follows:
INNER JOIN term_node tn ON n.nid = tn.nidINNER JOIN term_node tn ON n.nid = tn.nid
The whole story:
I am using Aggregator2 with Taxonomy-Theme (a combination that rocks, by the way).
I just discovered that I added the same aggregator2 feed twice, with a different path-alias each time.
I started correcting by deleting one of the 2 feeds, on the mistaken assumption that all the feed-item chldren would be deleted automatically. Mistake!
Now I am deleting the feed items one at a time and getting the error messages above.
Clearly the SQL is malformed, but I cannot identify the point in the code where the bad SQL is constructed.
A scan of the source produces the following locations as suspect sites for the error:
=================================================
tapenews000\modules\node.module(806):
'options' => $terms,
'join' => 'INNER JOIN {term_node} tn ON n.nid = tn.nid');
tapenews000\modules\taxonomy.module(839): $sql =
'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n
INNER JOIN {term_node} tn ON n.nid = tn.nid
WHERE tn.tid IN ('. $str_tids .')
AND n.status = 1
ORDER BY n.sticky DESC, n.created DESC';
tapenews000\modules\taxonomy.module(840):
$sql_count =
'SELECT COUNT(DISTINCT(n.nid))
FROM {node} n
INNER JOIN {term_node} tn ON n.nid = tn.nid
WHERE tn.tid IN ('. $str_tids .')
AND n.status = 1';
tapenews000\modules\taxonomy.module(846):
$joins .= ' INNER JOIN {term_node} tn'. $index .' ON n.nid = tn'. $index .'.nid';
=============================================
I cannot figure out from where any of these lines would be getting called.
Would sombody more knowledgeable than I please comment?
Comments
This is an issue with aggregator2
I'm sure a bug like this will be fixed in short order. It needs to have a project created locally before you can file tickets.
See my comments on the issue created at http://drupal.org/node/32326
Suggestion for tracing the execution of a drupal module? Please
This is, if you will excuse me for saying so, VERY BAD NEWS!!!
a) the aggregator2 module is a beautiful thing.
b) when I looked last the author of aggregator2 was still complaining that he wasn't allowed to open and official drupal project for his work and was stuck in CVS limbo (or something like that).
Can you make any suggestion for how one sets about tracing the execution of a drupal module???
I need this functionality, but I don't know drupal all that well.
I'll debug it myself if that's what's needed.
Suggestion? Please? Pretty Please???
I got account :)
So soon there will be project created and RC4 or 1.0 released.
You'll be able to create issue for it so we can work on it :)
Thanks for report.
Regards
ahwayakchih
Updated CVS
Can You try new CVS version? It doesn't support node access rules for it's blocks (for now) so we can see if it was fault of aggregator2 code or something else.
http://drupal.org/node/32384