The tag cloud module doesn’t seem to display the correct results if I pass multiple categories. The tag cloud is displaying tags which do not occur in the passed categories.
SQL debugging shows:
"Select cat_id FROM exp_categories WHERE site_id IN ('1') AND cat_url_title = '26|27|29|30|56'"
Which appears to come from here.
if ( $this->_numeric( $TMPL->fetch_param('category') ) === TRUE )
{
$cat_id = $TMPL->fetch_param('category');
}
elseif ( preg_match( "/C(\d+)/s", $TMPL->fetch_param('category'), $match ) )
{
$cat_id = $match['1'];
}
else
{
$cat_q = $DB->query( "SELECT cat_id FROM exp_categories WHERE site_id IN ('".implode("','", $TMPL->site_ids)."') AND cat_url_title = '".$DB->escape_str( $TMPL->fetch_param('category') )."'" );
if ( $cat_q->num_rows > 0 )
{
$cat_id = '';
foreach ( $cat_q->result as $row )
{
$cat_id .= $row['cat_id']."|";
}
}
}
Should this be included in the above code so that multiple categories are accepted?
$this->_numeric( str_replace( "|", "", $TMPL->fetch_param('category') ) ) === TRUE
It seems to fix the issue in my case.
Thanks,
Shawn
