Postponed (maintainer needs more info)
Project:
Index
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Mar 2010 at 12:35 UTC
Updated:
11 Nov 2010 at 10:42 UTC
Hello!
When I try to visit the newly created index page, I get this error:
user warning: Table 'db.vocabulary' doesn't exist query: SELECT * FROM vocabulary in /public_html/drupal/sites/all/modules/index/includes/index.entity.inc on line 30.
I excluded my database name and the full path if that's ok..
I'm guessing here but maybe this is because I have set a prefix for my database (drupal_) and the module isn't aware of this?
Thanks.
Comments
Comment #1
xanoPrefixing shouldn't cause any problems. It seems like {vocabulary} really doesn't exist. Do you have Taxonomy.module installed? Index doesn't yet check if data types are actually provided when displaying the index add form, which means you can add terms, vocabularies, comments etc even if Taxonomy or Comment aren't even installed.
Comment #2
jussi commentedTaxonomy is definitely installed and configured. I've got this error on two Drupal installations but maybe this is just a case of me not understanding how Index's interface works. :-) I'll mess with it some more.
Comment #3
xanoThe UI should work without giving you any kind of trouble. If it does, it's a bug in Index.
Comment #4
jussi commentedOkay, had a go with differents types of indexes:
Comments:
user warning: Table ''db.comments' doesn't exist query: SELECT * FROM comments in [path excluded]/www/drupal-6.16/sites/all/modules/index/includes/index.entity.inc on line 30.Content: seems to work.
Content types:
user warning: Table 'db.node_type' doesn't exist query: SELECT * FROM node_type in [path excluded]/www/drupal-6.16/sites/all/modules/index/includes/index.entity.inc on line 30.Rules: seems to work.
Terms: seems to work.
Users: seems to work.
Vocabularies:
user warning: Table 'db.vocabulary' doesn't exist query: SELECT * FROM vocabulary in [path excluded]/www/drupal-6.16/sites/all/modules/index/includes/index.entity.inc on line 30.Real puzzling! Luckily I'm not in too much of a trouble here, currently Vocabulary Index does its job "good enough" for me. I was curious if the same could be achieved with Index while also possibly fixing couple of anooyances.
Comment #5
xanoCan you provide setp-by-step instructions on how to reproduce these errors using a clean installation of Drupal 6.x-dev and Index 6.x-1.x-dev?
Comment #6
esteewhy commentedHello.
The root cause of this (mis)behaviour is because at ./includes/index.entity.inc:74 variable $table is enclosed in a curly braces within a double-quotes, so, under PHP rules, curly braces are interpreted as a part of variable-expansion syntax, thus are not present in the final string. In turn, this leads to ignoring table prefix entirely.
The fix is to escape curly braces by doubling them (id est: "SELECT * FROM {{$table}}"). This is trivial, so no patch, sorry.
BTW, the same pattern (variable within a single curly braces within a double quotes) is repeating several more times, so beware.
Comment #7
esteewhy commented..Also, function index_entity_count_node() contains a bug, which leads to incorrect query if "tid" were passed as a key. One can easily spot this just inspecting the code: there'll be something like:
which, of course, is incorrect (trying to get "tid" from a {node} table).
The fix is not a rocket science, here's a possible refactured code (sorry, too lazy for patching):