Hi,
I have been trying to generate sitemap after selecting the content type and specifying start node and end node id. But I keep getting this error:
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 'IMAGE/PNG 'image/png', 'image/jpg', 'image/gif', 'image/jpeg') ORDER BY n.creat' at line 3: SELECT n.nid AS nid, n.created AS created, n.title AS title, f.uri AS uri FROM {node} n INNER JOIN {file_usage} fu ON n.nid = fu.id INNER JOIN {file_managed} f ON fu.fid = f.fid WHERE (n.type = :db_condition_placeholder_0) AND (n.status = :db_condition_placeholder_1) AND (f.filemime IMAGE/PNG :db_condition_placeholder_2_0, :db_condition_placeholder_2_1, :db_condition_placeholder_2_2, :db_condition_placeholder_2_3) ORDER BY n.created DESC, f.timestamp DESC LIMIT 24 OFFSET 0; Array ( [:db_condition_placeholder_0] => photo [:db_condition_placeholder_1] => 1 [:db_condition_placeholder_2_0] => image/png [:db_condition_placeholder_2_1] => image/jpg [:db_condition_placeholder_2_2] => image/gif [:db_condition_placeholder_2_3] => image/jpeg ) in _google_image_sitemap_build() (line 274 of ../public_html/drupal/sites/all/modules/google_image_sitemap/google_image_sitemap.module).
Any help would be appreciated.
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | google_image_sitemap-7.x-1.0.zip | 11.82 KB | CowBoy |
Comments
Comment #1
CowBoy commentedI have the same problem when I try generating the Image Sitemap:
Thanks in advance!
Comment #2
CowBoy commentedJust install the module and edit it. Replace line 270 of the code as shown:
1) - To be replaced:
$query->condition('f.filemime', array('image/png', 'image/jpg', 'image/gif', 'image/jpeg'), 'image/png');- Replace with:
$query->condition('f.filemime', array('image/png', 'image/jpg', 'image/gif', 'image/jpeg'), 'IN');2) Or download the attached module installation file and use it with your Drupal 7.x.
A big thanks goes to the developers of this module!
Comment #4
FAAREIA commentedThanks cowboy, it work for me.
I'll change the status and see what others said about this patch.
Comment #5
zionduc commentedCowBoy's patch works fine for me too.
Thank you for this module and for this patch.
Comment #6
amitgoyal commentedThanks CowBoy! This has been incorporated in the new release 7.x-1.1.