Keyword

Tags: spaces at the beginning do not get stripped

  • Oceanwatcher
  • Oceanwatcher's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 3 weeks ago #87672 by Oceanwatcher
I have been pasting in tags a couple of times and were not aware that the tag had a space at the beginning.This results in tags being sorted wrong and there is no way to fix it as the tag that is stored and shown if you try to edit it is without the space.It is especially annoying when using JoomFish as the tags in JoomFish are sorted alphabetically and it can be very difficult to find the right tag if you have a lot...

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

More
14 years 3 weeks ago #87673 by David R.
I agree this is a bug that could be fixed very simply with a trim statement. There's no reason to allow tags to have leading or trailing spaces. I'm having to fix tags that a client has added where he put in hundreds of tags using the comma and out of habit always typed a space or two. Now I'm having to clean this up with SQL.

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

More
14 years 3 weeks ago #87674 by Lefteris
Hi. Fixed at the SVN version. Thanks for reporting.

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

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

More
14 years 3 weeks ago #87675 by David R.
Thanks Lefteris!

Lefteris Kavadas said:Hi. Fixed at the SVN version. Thanks for reporting.

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

  • Oceanwatcher
  • Oceanwatcher's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 3 weeks ago #87676 by Oceanwatcher
Replied by Oceanwatcher on topic Tags: spaces at the beginning do not get stripped
Thank you. Looking forward to the release! :-)

Now we only need to be able to add tags with hyphens. There are a lot of words that need hyphens according the correct way of spelling them in many languages, so this HAS to be in there!

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

More
14 years 3 weeks ago #87677 by David R.
FWIW, if people want to put in a quick hack until the official release:

Go into /administrator/components/com_k2/tables/k2tag.php

remove function check(), and replace it with this code:

function check() {
$this->name = trim($this->name);
if ($this->name == '') {
$this->setError(JText::_('Tag cannot be empty'));
return false;
}
$this->name = str_replace('-','',$this->name);
return true;
}

Notice the str_replace for the '-' is one of the reasons that hyphens get removed. Commenting that out,, and in several other places and you can save tags with hyphens. The problem is that the tags module breaks when you click on articles related to the tag with hyphen, because for some reason, when the hyphenated parameter gets passed in the url, it ultimately gets changed from:

foo-bar

to

foo:bar

I ran out of time trying to understand what is going on inside of Joomla, as this appears to be related to the JDatabase Quote() function, afaik. Since this replace for hyphens is put in a number of different places, it makes me think that the K2 guys might have seen some issue with this, or that there's some security related issue with hyphens that causes the joomla api to modify them. Or it might also be related to the controller code and joomla's use of a ':" to pack url params.

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


Powered by Kunena Forum