tag cloud multiple categories
Posted: 21 May 2008 12:41 PM   [ Ignore ]
Newbie
Rank
Total Posts:  17
Joined  2007-08-29

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

Profile
 
 
Posted: 22 May 2008 06:12 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Shawn,

Good catch smile

I’ll queue this up for the next release wink

 Signature 
Profile
 
 
Posted: 03 September 2008 07:29 PM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Shawn,

This is now fixed in Tag 2.1.2 smile

 Signature 
Profile
 
 
Posted: 03 September 2008 07:34 PM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  17
Joined  2007-08-29

You guys are rockstars!

-Shawn

Profile