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?
I have created HOW-DO-I thread at:
BUG!? Aggregator2? Taxonomy-Theme? taxonomy.module? Node Deletion throws SQL Errors
=============================================
I dont know of any way to turn on tracing in drupal (sorry, am relative newbie), nor is there anything like a stack trace so far as I can see, nor would I expect one. But that leaves me in the cold for debugging this.
Please HELP !!!!!!!!!!!!!
Comments
Comment #1
boris mann commentedAggregator2 does not have a local project created yet. It is a bug in that module, not with Drupal. I've set status to postponed until the aggregator2 module is created here locally.
Comment #2
joeblough commentedThis 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???
Comment #3
forngren commentedI don't think this is still an issue, and if so, please reopen.