Closed (fixed)
Project:
Quotes
Version:
6.x-1.x-dev
Component:
Upgrading
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Apr 2009 at 03:25 UTC
Updated:
25 May 2009 at 20:50 UTC
I had Quotes installed in v6.4 and just upgraded to v6.10. This is a test environment so it's possible something happened that's site-specific here but I'm documenting this in case it comes up elsewhere. On upgrading Drupal I also upgraded Quotes. The release ID is 6.x-1.x-dev. The prior version was from 2008-08-24 (according to quotes.info) and the current build is from 2009-03-15.
user warning: Unknown column 'none' in 'where clause' query: SELECT n.nid FROM quotes q INNER JOIN node n ON q.vid=n.vid WHERE n.status=1 AND n.type='quotes' AND q.promote = 1 AND (q.aid IN (none)) ORDER BY RAND() LIMIT 0, 1 in /home/.koontah/fatcat/portals/test01/sites/all/modules/quotes/quotes.module on line 1225.
The code that generates the query looks like this:
$query = 'SELECT n.nid FROM {quotes} q INNER JOIN {node} n ON q.vid=n.vid '
. quotes_block_join_sql($filters)
.'WHERE n.status='. (int)($filters['block_type'] != 2) /* Type=2 is unpublished. */
." AND n.type='quotes' AND "
. ($promoted_only ? ' q.promote = 1 AND ' : '')
. quotes_block_where_sql($filters)
.' ORDER BY '. ($filters['block_type'] == 0 ? 'RAND()' : 'n.created DESC'); /* Type=0 is random. */The error is coming from quotes_block_where_sql from this statement:
if ($filters['aid_filter']) {
$where[] = " (q.aid IN ($filters[aid_filter])) ";
}It seems that somehow the author filter isn't defined but manages to get passed through the code even as "none". I'm not adept enough with PHP to see exactly how this is happening, sorry.
HTH
Comments
Comment #1
vitzo.com commentedSame issue here.
Comment #2
nancydruOkay, I have to ask, did you run update.php?
Comment #3
nancydruHmm, it looks like possibly the old version allowed 'None' to be selected in the author filter (which it should have, but doesn't now). The new code is not recognizing that as valid.
Comment #4
nancydruI just committed a fix (to 6.x-1.x-dev) that allows the block filters to be turned off, which I think is what you need to do.