Problems with tags

Parisi

Member
We have a couple of problems with Tags on our Beza site (it is in our profile):
  • We have the following tags in our list, here is an example:
    1. Lordship
    2. Lord's Prayer
When a user tries to type Lord's Prayer and goes to select that tag it goes crazy and they cannot enter the tag. How would we go about fixing this?​
  • Somehow we have multiple entries in our tag list. We have several Lordship entries and even some lordship entries. How would we go about fixing this?
  • How can we prevent users from creating duplicate tags?
  • Occasionally, a user will select a tag and a glitch will occur and several (many) copies of the tag will be added. We cannot readily reproduce it but it happens very often.
 
thanks - the use case is when those two tags already exist - try to type Lord's Prayer.

If you could also help with the other three items as well that would be great
 
http://screencast.com/t/GR2S3dIj

I don't seem to be able to replicate a problem on your site? Maybe you could record a Jing screencast (Jing is free) of th problem?

As for duplicates, we are just using the standard J! tag manager (Tags, under Components), so we're not in control of that.

-- hugh
 
OK, the problem seems to be in J!'s com_tags ...

Code:
        // Receive request data
        $filters = array(
            'like'      => trim($app->input->get('like', null)),
            'title'     => trim($app->input->get('title', null)),
            'flanguage' => $app->input->get('flanguage', null),
            'published' => $app->input->get('published', 1, 'integer'),
            'parent_id' => $app->input->get('parent_id', null)
        );

... where that get() on the 'like' does an implicit getCmd(), which strips everything except letters, numbers, underscores, hyphens and periods ...

Code:
                $result = (string) preg_replace('/[^A-Z0-9_\.-]/i', '', $source);

So it never includes the ' in the query. I'm not sure why your site has that bizarre behavior after the search, I can't replicate that.

What you could try is edit ./components/com_tags/controllers/tags.php, line 31, change ...

Code:
            'like'      => trim($app->input->get('like', null)),

... to ...

Code:
            'like'      => trim($app->input->getString('like', null)),

Which should allow the quotes in the search. Seems to work for me, and I've done limited testing with combinations of quotes to make sure the tag query building is safe with quotes in the query.

Hopefully that will fix even the 'bizarre behavior' I can't replicate here, as it should mean that whatever condition causes that (which I suspect has something to do with the returned responses not containing the text in the box, although why that would affect you and not me I don't know) doesn't arise any more, if the query responses are correct.

-- hugh
 
Last edited:
Hugh,

Thanks for the notes. I made the changes and it seems to help. It sill seems that the J! functionality is not all it should be, it just behaves strangely. Especially when I type "Lord's P" and then hit the backspace key.

I will bring it up to the core team as a bug report.

Any thoughts on the proliferation of copies of tags and how to remedy that?

Thanks,
Paul.
 
The copies is again a J! issue. We just use the J! com_tags API, we don't have anything to do with how they get created, and preventing duplicates. I was surprised there isn't an option in the tags component to prevent dupes.

I could possibly do some work on com_tags, then submit a PR on the J! CMS github repo, and hope they merge it. But that would have to be billable work, and there's never any guarantee that the J! Godz will approve a PR.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top