Keyword

Bugs with non-standard symbol in tags

  • Mikhail Jakovlev
  • Mikhail Jakovlev's Avatar Topic Author
  • Offline
  • New Member
More
13 years 9 months ago #92355 by Mikhail Jakovlev
Bugs with non-standard symbol in tags was created by Mikhail Jakovlev
Hello guys, I have couple of questions about tagging in K2. I’ve tried to find out answers myself with no luck. I would be grateful if somebody could help me.

First problem is with '&' symbol in K2 tags and sh404SEF. For example, we have tag ‘Van Cleef& Arpels’. In SEF it becomes /tag/van-cleef-arpels pointing to:index.php?option=com_k2&lang=ru&limitstart=&tag=Van Cleef&task=tag&view=itemlist So the part of tag after ‘&’ symbolwas lost. It should refers to:index.php?option=com_k2&lang=ru&limitstart=&tag=Van+Cleef+%26+Arpels&task=tag&view=itemlist

I’ve managed totemporary solve problem by manual editing of SQL section jos_redirection, but it’s very ugly solution. I've tried to find answers on sh404SEF developer's forum, but support says, that problem is with K2 SEF plugin.

Second bug: apostrophesymbol in tags. For example, tag “Mike's” in url will be transformed to tag=Mike\'s and the result is also empty page. Temporary solution: use ’ symbol instead standard '.

And the third problemis with dash symbol in tags. So ‘New-York’ become ugly ‘NewYork’. It works, but I don’t like the way it works.

Please Log in or Create an account to join the conversation.

  • Mikhail Jakovlev
  • Mikhail Jakovlev's Avatar Topic Author
  • Offline
  • New Member
More
13 years 6 months ago #92356 by Mikhail Jakovlev
Replied by Mikhail Jakovlev on topic Bugs with non-standard symbol in tags
I’ve found solution with dashes. If somebody as me wants to keep dashes in tags, you need to remove $this->name = str_replace('-','',$this->name); from /administrator/components/com_k2/tables/k2tag.php
and           $tag = str_replace('-','',$tag); from
/administrator/components/com_k2/models/tag.php
/administrator/components/com_k2/models/item.php
 
And it works fine! Keep looking solutions for other tags issues.

Please Log in or Create an account to join the conversation.

  • Mikhail Jakovlev
  • Mikhail Jakovlev's Avatar Topic Author
  • Offline
  • New Member
More
13 years 6 months ago #92357 by Mikhail Jakovlev
Replied by Mikhail Jakovlev on topic Bugs with non-standard symbol in tags
Here are solution for ampersand symbol. We need to add string $tag = str_replace('&','',$tag); in file components/com_k2/sef_ext/com_k2.php after

            case 'tag':

                $title[] = 'tag';

(around 155th string)

 

Still looking for solution with apostrophe ($tag = str_replace('%27','',$tag); — doesn’t work). Temporary I’ve solved it by replacing ’ symbol instead standard '.

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #92358 by Joe Campbell
Replied by Joe Campbell on topic Re: Bugs with non-standard symbol in tags
Can someone please provide a solution for the current version of K2.

I tried adding:
$tag = str_replace('&','',$tag);

to the /components/com_k2/sef_ext/com_k2.php

My URLs still come render as...
/tag/tagpreampersand?tagpostampersand=

Note: I am using sh404SEF

PLEASE HELP!!!

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #92359 by Lefteris
Replied by Lefteris on topic Re: Bugs with non-standard symbol in tags
@Joseph

Hi. There is no solution for that. This is a restriction of the current K2 tagging system. We have changed this for the upcoming version 3 of K2. Until then you are recommended to not hack K2 code.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum