Hello,
I upgraded a dev site to 2.1.1 this evening from 2.1.0 and am receiving the following error from the comment entries tag: {exp:comment:entries sort="asc" limit="20"}
Error
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 ‘AND entry_id = ‘11’
AND `exp_channel_titles`.`channel_id` = exp_channels.channel’ at line 3
SELECT `entry_id`, `exp_channel_titles`.`channel_id`
FROM (`exp_channel_titles`, `exp_channels`)
WHERE AND entry_id = ‘11’
AND `exp_channel_titles`.`channel_id` = exp_channels.channel_id
AND `exp_channel_titles`.`site_id` IN (‘1’)
AND (`expiration_date` = 0 OR `expiration_date` > 1287451501)
AND `status` != ‘closed’
AND `exp_channel_titles`.`channel_id` = ‘2’
Filename: modules/comment/mod.comment.php
Line Number: 282
The template generating the error has the following comment entries tag:
{exp:comment:entries sort="desc" entry_id="{embed:entry_id}" channel="projects" dynamic="no"}
The error only occurs if I pass the entry_id or url_title params. It appears the following code causes the error:
// Check if an entry_id or url_title was specified
if ($entry_id = $this->EE->TMPL->fetch_param('entry_id'))
{
//$this->EE->db->where('entry_id', $entry_id);
$sql = $this->EE->functions->sql_andor_string($entry_id, 'entry_id');
$this->EE->db->where($sql, NULL, FALSE);
}
elseif ($url_title = $this->EE->TMPL->fetch_param('url_title'))
{
//$this->EE->db->where('url_title', $url_title);
$sql = $this->EE->functions->sql_andor_string($url_title, 'url_title');
$this->EE->db->where($sql, NULL, FALSE);
}Thoughts?
Thanks,
Shawn