Not unique table/alias error when filtering then sorting by keyword
| Project: | Bibliography Module |
| Version: | 6.x-1.5 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | filter, keyword, PHP, table/alias |
Jump to:
After filtering to a specific keyword, then sorting by keyword, I get the following error:
user warning: Not unique table/alias: 'bk' query: SELECT COUNT(DISTINCT(n.nid), bkd.word) FROM drupal_node n left join drupal_biblio b on n.vid=b.vid inner join drupal_biblio_types bt on b.biblio_type=bt.tid JOIN drupal_biblio_keyword as bk on b.vid = bk.vid JOIN drupal_biblio_keyword_data as bkd on bk.kid = bkd.kid inner join drupal_biblio_keyword as bk on n.vid = bk.vid WHERE (bk.kid = 37 ) AND (n.type='biblio' ) in [...]sites/all/modules/biblio/biblio.pages.inc on line 87.
user warning: Not unique table/alias: 'bk' query: SELECT DISTINCT(n.nid), n.*, b.*, bt.name as biblio_type_name, bkd.word as biblio_keyword FROM drupal_node n left join drupal_biblio b on n.vid=b.vid inner join drupal_biblio_types bt on b.biblio_type=bt.tid JOIN drupal_biblio_keyword as bk on b.vid = bk.vid JOIN drupal_biblio_keyword_data as bkd on bk.kid = bkd.kid inner join drupal_biblio_keyword as bk on n.vid = bk.vid WHERE (bk.kid = 37 ) AND (n.type='biblio' ) ORDER BY bkd.word desc LIMIT 0, 10 in [...]sites/all/modules/biblio/biblio.pages.inc on line 87.
This error occurs if there is only one entry after filtering, or if there are more than one. It won't occur for any other combination of filter/search. The error occurs for all keywords. It also occurs if I try to refine the filter with another keyword.

#1
Thanks for reporting that, it's a known problem which is not likely to be fixed immediately. I say this because I'm currently in the process of converting all the query and display code to use the Views module which will likely solve this problem.
Ron.