Needs review
Project:
Archive
Version:
7.x-1.3-alpha1
Component:
Block
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Aug 2011 at 22:49 UTC
Updated:
11 Jun 2012 at 19:21 UTC
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1: SELECT n.uid AS uid, n.created AS created FROM {node} n WHERE (n.status = :db_condition_placeholder_0) AND (n.type IN ()) ; Array ( [:db_condition_placeholder_0] => 1 ) in function _archive_post_count() (row 385 in file ................../sites/all/modules/archive/archive.module).
Comments
Comment #1
sandu.camerzan commentedYes, I got this bug as well.
I found and fixed the issue, but I don't know how to create a patch using Git for Drupal.org, I'll have to look into it for improving my future contributions.
The fix:
This is the problem: When adding an IN condition to a dynamic query, in this case
$node_query->condition('n.type', $final_types, 'IN')will throw errors when the$final_typesvariable passed is empty or not an array.Hope this helps. Sorry again for not submitting a patch, as the best way should be. Have a nice day!
Comment #2
jasonglisson commentedThis fixed my error message for the calendar block. But now when I click on one of the link within the calendar block, I get this.
Obviously it's a pager.inc conflict. But does anyone know what the fix would be?
Comment #3
mlleepeter commentedI had had same problem but it seems to be fixed after I set the available content type into a certain type (such as "article") in /admin/config/user-interface/archive.