tags with apostrophe don’t work?
Posted: 11 April 2008 10:05 AM   [ Ignore ]
Newbie
Rank
Total Posts:  2
Joined  2008-04-11

While doing some testing, I made a tag with the name: you’re it

This shows up in the tag cloud fine, but when I click on the link to visit the tag entries page (example.com/tag/you’re+it), I get this MySQL error:

MySQL ERROR:

Error Number1064

Description
You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near 're it') AND e.type 'weblog'' at line 5

Query: SELECT DISTINCT(e.entry_id), t.tag_id FROM exp_tag_entries e LEFT JOIN exp_tag_tags t ON t.tag_id = e.tag_id WHERE t.site_id IN ('
1') AND t.tag_name IN ('you're it') AND e.type 'weblog' 

Here’s the code I’m using to list out the tag links:

{exp:tag:cloud groups="4" step="2" limit="20"}
 
<li><a href="{path=tag}{websafe_tag}" title="{tag_name}" style="font-size:{step}px;">{tag}</a></li
{/exp:tag:cloud} 

Is there a way to get tags with apostrophes in them to not error when you link to them? Thanks.

Profile
 
 
Posted: 14 April 2008 06:50 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8223
Joined  2006-10-18

chrisrhee,

I can duplicate this issue, though it only seems to happen on some web servers. I have one site that generates this error, and a few that don’t (when running a tag with an apostrophe in the URL).

I’ll note this bug and we’ll try to get it fixed as shortly smile

Thanks for your patience…

 Signature 
Profile
 
 
Posted: 17 October 2008 10:18 AM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8223
Joined  2006-10-18

This is now fixed with the new version of Tag 2.5 smile
http://www.solspace.com/forums/viewthread/661/

 Signature 
Profile
 
 
Posted: 12 July 2009 04:30 PM   [ Ignore ]   [ # 3 ]
Newbie
Avatar
Rank
Total Posts:  13
Joined  2008-11-16

I am getting a “Disallowed Key Characters” with this tag link:
http://www.afewdayslater.com/artifacts/artifact_tags/tag/30’s

here is my template code:

<div id="all-tags" class="clearfix">
<
h2>All tags</h2>
<
ul>
{exp:tag:cloud weblog="{my_weblog}" groups="1" limit="25"}
<li class="tag"><a href="{path='/artifacts/artifact_tags/tag'}{websafe_tag}" title="{tag}">(<span class="tag-number">{weblog_entries}</span>) {tag}</a> </li>
{/exp:tag:cloud} 

I am using build : Solspace’s Tag 2.6.4 Module
Current Version: 2.6.4 - Build: 20090609

Profile
 
 
Posted: 13 July 2009 02:06 PM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8223
Joined  2006-10-18

hungrysquirrel,

Do you have Force Query Strings setting on? smile
If not, what does your main .htaccess file look like? smile

 Signature 
Profile
 
 
Posted: 13 July 2009 04:04 PM   [ Ignore ]   [ # 5 ]
Newbie
Avatar
Rank
Total Posts:  13
Joined  2008-11-16

Do you have Force Query Strings setting on?
Is this the setting: Admin > Output and Debugging Preferences in the Control Panel?
If so it is set to NO.

If not, what does your main .htaccess file look like?

RewriteEngine On
RewriteCond 
$!\.(gif|jpe?g|png)$ [NC]
RewriteCond 
%{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
RewriteRule 
^(.*)$ /index.php?/$1 [L] 

Thanks for having a look smile

Profile
 
 
Posted: 14 July 2009 07:18 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8223
Joined  2006-10-18

See, even though you have “Force Query Strings” set to OFF, you’re using them with your .htaccess file (notice the question mark): :)

RewriteRule ^(.*)$ /index.php?/$1 [L] 

Unfortunately special characters do not work with Query Strings on, and some web servers require them for the .htaccess rewrite.
Does your site break if you change your .htaccess to this:

RewriteEngine On
RewriteCond 
$!\.(gif|jpe?g|png)$ [NC]
RewriteCond 
%{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
RewriteRule 
^(.*)$ /index.php/$1 [L] 
 Signature 
Profile
 
 
Posted: 14 July 2009 08:40 PM   [ Ignore ]   [ # 7 ]
Newbie
Avatar
Rank
Total Posts:  13
Joined  2008-11-16

Yes it does break with the new snippet. I get this message “No input file specified.”

If it’s not possible to work around that then I imagine I could change “30’s” for “30s”

Would that be your recommendation?

Thanks for your awesome support! smile

Profile
 
 
Posted: 15 July 2009 06:29 PM   [ Ignore ]   [ # 8 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8223
Joined  2006-10-18
hungrysquirrel - 14 July 2009 08:40 PM

If it’s not possible to work around that then I imagine I could change “30’s” for “30s”

Would that be your recommendation?

Correct. It’s best to avoid special characters altogether smile
In the future, we plan to add an automatic character convertor to help with this to make it a little more idiot proof wink

 Signature 
Profile