Fatal error: Not unique table/alias: 'n' query: SELECT DISTINCT i.sid, i.type
FROM search_index i INNER JOIN node n ON n.nid = i.sid
INNER JOIN node n USING (nid)
INNER JOIN users u ON n.uid = u.uid WHERE
n.status = 1 AND
(n.language ='cz' or n.language = '')
AND (i.word LIKE 'kniho%')
the trouble part is in the third line INNER JOIN node n USING (nid) , because there are duplicate "n" aliases
the condition is added in i18n_db_node_rewrite(), the symptoms disapper when you delete the alias from the code, or replace it (for example by x INNER JOIN node x USING (nid) ) or return from this function immediately.
I am new to version 4.6, so don't know if this condition is necessary - what is this condition useful for?
But perhaps, Jose wanted to write && instead of ||
if ($primary_table != 'n' && !strstr($query, '{node}')) {
$result['join'] = 'INNER JOIN {node} n USING (nid)';
$alias = n;
}
P.S. imho, adding of language condition is not necessary, when user wants to search our sites, s/he probably expects to do searching in all the content not in the language specific pages
regards
Comments
Comment #1
romca commentedregarding the language condition
it is necessary to add it there for everything else, except when searching
Comment #2
jose reyero commentedComment #3
jose reyero commented