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.

CommentFileSizeAuthor
#8 querytest.patch855 byteskidsleep
#2 query.patch1021 byteskidsleep

Comments

kidsleep’s picture

This 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.

kidsleep’s picture

StatusFileSize
new1021 bytes

This patch fixes the errors above by allowing table prefixes using the methods I described above.

Kidsleep

kidsleep’s picture

Status: Active » Needs work

Whoops. I forgot to change the status.

zeta ζ’s picture

Status: Needs work » Needs review
zeta ζ’s picture

Status: Needs review » Reviewed & tested by the community

Just 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).

zeta ζ’s picture

This is in version 1.4.2.1 apparently!

zeta ζ’s picture

Similar bugs in /tests/nodecarousel.test (4 instances: lines 17,24,33,34)

kidsleep’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new855 bytes

Here is a patch to fix the queries in the test file.

zeta ζ’s picture

Status: Needs review » Needs work

Patch 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.

jcfiala’s picture

Apologies - 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.

jcfiala’s picture

Yeah, 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!