exp:tag:entries with special chars in tag name
Posted: 12 May 2008 06:58 PM   [ Ignore ]
Newbie
Rank
Total Posts:  9
Joined  2007-08-29

Hey Guys,

I’m using the tag module and getting stuck when tags have commas.

The tags are company names and are often formatted as company, LLC

If there is a comma in the tag name then exp:tag:entries returns no results.

Query is
SELECT DISTINCT(e.entry_id) FROM exp_tag_entries AS e LEFT JOIN exp_tag_tags AS t ON e.tag_id = t.tag_id WHERE BINARY t.site_id IN (’1’)AND t.tag_name IN (’Company’, ‘LLP’) AND e.type = ‘weblog’

But Query should be
SELECT DISTINCT(e.entry_id) FROM exp_tag_entries AS e LEFT JOIN exp_tag_tags AS t ON e.tag_id = t.tag_id WHERE BINARY t.site_id IN (’1’)AND t.tag_name IN (’Company, LLP’) AND e.type = ‘weblog’

Any thoughts?

Thanks,
Shawn

Profile
 
 
Posted: 13 May 2008 06:28 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  1901
Joined  2006-10-18

Shawn,

The trouble is that the Tag Entries loop looks at commas as Tag seperators in the event that you have multiple Tags in the URL.
As you can see, when Company, LLC is specified, it’s looking for ”Company” and ”LLC” as seperate Tags.

I’ll check with Mitchell as to where we can maybe comment out this parsing for your instance, that is, if you plan to not use multiple Tags in the Tag:Entries loop smile

 Signature 
Profile
 
 
Posted: 13 May 2008 07:05 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  9
Joined  2007-08-29

I figured as much.  At this point I don’t think I need multiple tags.  Was going to comment out this line last night $this->tag = str_replace( “,”, “|”, $this->tag ); but didn’t want to break anything.  Let me know what Mitchell thinks.

Thanks for your help.

-Shawn

Profile
 
 
Posted: 13 May 2008 03:25 PM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  9
Joined  2007-08-29

Commenting out the aforementioned line seems to work.  I hate hacking such a wonderful work of art.  Tell Mitchell to forgive me.

-Shawn

Profile
 
 
Posted: 14 May 2008 06:03 AM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  1901
Joined  2006-10-18

Haha, awesome! LOL

 Signature 
Profile