When I try to create a node carousel, I get this error:
user warning: Table '[mysqltablename].nodecarousel' doesn't exist query: SELECT count(*) as name_count FROM nodecarousel WHERE name = '[name]' AND ncid <> 3 in /[path to my site]/includes/database.mysql.inc on line 172.
The nodecarousel table does exist, but not as expected, because my site settings specify a table prefix. Nodecarousel seems to not take into account that the table was created at [mysqltablename_prefix].nodecarousel.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | querytest.patch | 855 bytes | kidsleep |
| #2 | query.patch | 1021 bytes | kidsleep |
Comments
Comment #1
kidsleep commentedThis is easily fixed by replacing line 889 with the following:
$query = 'SELECT count(*) as term_count FROM {term_data} WHERE tid IN (%s)';
replace line 952 with:
$query = "SELECT count(*) as name_count FROM {nodecarousel} WHERE name = '%s' AND ncid <> %d";
That should fix the errors.
Comment #2
kidsleep commentedThis patch fixes the errors above by allowing table prefixes using the methods I described above.
Kidsleep
Comment #3
kidsleep commentedWhoops. I forgot to change the status.
Comment #4
zeta ζ commentedComment #5
zeta ζ commentedJust found, and fixed this error in exactly the same way. Fixes the problem.
File could also do with a new line at the end (after comment).
Comment #6
zeta ζ commentedThis is in version 1.4.2.1 apparently!
Comment #7
zeta ζ commentedSimilar bugs in /tests/nodecarousel.test (4 instances: lines 17,24,33,34)
Comment #8
kidsleep commentedHere is a patch to fix the queries in the test file.
Comment #9
zeta ζ commentedPatch fixes line 17 only.
I didn’t want to do a patch for this as that would mean changing to “patch (code needs review)” instead of “patch (code reviewed and tested)” – but as previous patch is already in HEAD, this doesn’t matter.
Comment #10
jcfiala commentedApologies - I haven't figured out how to handle the information posted to drupal.org so I find it quickly. I'll take a look at this soon and try to incorporate it.
Comment #11
jcfiala commentedYeah, this is something that I had found and fixed in my personal development copy, but had forgotten to send on. I'm hoping to do a Devel update to cvs that will include this fix. Sorry!