A Database Error Occurred

Error Number: 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 '-1' at line 17

SELECT SQL_CALC_FOUND_ROWS i.*, DATE_FORMAT(i.publication_date, '%a, %e %b %Y') as display_date, '0' as featured, it.name as topic_name, it.reference as topic_reference, series.name as series_name, series.reference as series_reference, ccl.name as licence, ccl.url as licence_url, ccl.description as licence_description, '' as caption, 'idea' as `table_name`, it.name as list_type, i.short_description as meta_secondary_caption, (select count(*) from page_idea_xrefs pix where pix.idea_id = i.id AND pix.page_id = 4 AND pix.online = 1 and not pix.deleted <=> 2) as page_xrefs, _cv.code as content_lang, group_concat(distinct concat(translation.id, '#', translation.reference) order by version.`rank` asc) as translation_references, group_concat(distinct version.code order by version.`rank` asc) as version_codes FROM (idea i) JOIN idea_topic it ON it.id = i.idea_topic_id AND (if(it.id is not null, it.online = 1 and not (it.deleted <=> 2), 1)) LEFT JOIN idea_serie_idea_xrefs xrefs ON xrefs.idea_id = i.id AND (if(xrefs.id is not null, xrefs.online = 1 and not (xrefs.deleted <=> 2), 1)) LEFT JOIN idea_serie series ON series.id = xrefs.idea_serie_id AND (if(series.id is not null, series.online = 1 and not (series.deleted <=> 2), 1)) LEFT JOIN cc_licence ccl ON ccl.id = i.cc_licence_id AND (if(ccl.id is not null, ccl.online = 1 and not (ccl.deleted <=> 2), 1)) LEFT JOIN idea translation ON translation.translation_id = i.translation_id and (if(translation.id is not null, translation.online = 1 and not (translation.deleted <=> 2), 1)) LEFT JOIN _conf_version version ON version.id = translation.version_id JOIN _conf_version _cv ON _cv.id = i.version_id WHERE (i.publication_date <= NOW() OR i.publication_date IS NULL) AND (if(i.id is not null, i.online = 1 and not (i.deleted <=> 2), 1) AND i.version_id = 1) AND NOT i.hide_in_list <=> 1 AND it.reference = 'collection-spotlight' GROUP BY i.id ORDER BY ISNULL(i.publication_date), i.publication_date desc, i.name LIMIT -1

Filename: /var/www/html/aaa.org.hk/skins/aaa/php/models/m_idea.php

Line Number: 204