Darren, This is a sweet module

I use mostly content taxonomy but I got around to testing active_tags because users aren't good at surrounding complicated terms with quote marks.

Use: Autocomplete of Authors as a taxonomy
Example entry: "SEN, Amartya"

Problem: Active tags separates entries with commas -- despite the quote marks

I have attached two quick screenshots to demonstrate

Many thanks!

R3

CommentFileSizeAuthor
#12 2009-09-15 taxonomy_single_tag.zip3.52 KBarhak
at2.jpg7.65 KBrup3rt
at1.jpg7.65 KBrup3rt

Comments

rup3rt’s picture

- Correct 2nd screenshot at http://img5.imageshack.us/img5/6416/at2uu2.jpg

- Code from taxonomy module is around line 1290

      // Commas and quotes in tag names are special cases, so encode 'em.
      if (strpos($tag->name, ',') !== FALSE || strpos($tag->name, '"') !== FALSE) {
        $tag->name = '"'. str_replace('"', '""', $tag->name) .'"';
      }

      $typed_tags[] = $tag->name;
    }
  }
  return implode(', ', $typed_tags);

R3

rup3rt’s picture

Quotes override broken but I saw this and understood more about the process

Commit #140777 by darrenmUK at 05:55
Active Tags: /modules/active_tags/active_tags.js 1.1.2.2 @ DRUPAL-6--1
Comma in Active Tags entry widget now splits multiple tags

This could be optional........

  • Checkbox with "Treat entry field as a single term?" to set a variable
  • Default set as a field for multiple terms and with comma separation enabled

    Will add "Treat entry field as a single term" as a new feature request :-)

    R3

  • dragonwize’s picture

    Category: bug » feature
    Status: Active » Postponed

    Hi rup3rt. This sounds like a nice feature to have. We will have to think about it and decide if and how to implement it.

    Marking postponed until we decide.

    dragonwize’s picture

    Title: Quotes don't override comma » Treat entry field as a single term including commas
    francewhoa’s picture

    +1 for this new feature. I would be happy to contribute testing.

    dragonwize’s picture

    The future of this feature lies in the outcome of the discussion in this issue: #412578: Tags are not submitted if user does not click add. If you have an opinion on that discussion please join in.

    janusman’s picture

    Category: feature » bug
    Status: Postponed » Active

    Could I convince you that the current implementation has a bug (in the Javascript), because terms (already) entered by the autocomplete field like this:

    "Emerson, Lake and Palmer", The Cure

    after installing this module, get converted by the JS in this module (erroneously) as:

    1) "Emerson
    2) Lake and Palmer"
    3) The Cure

    even though the core autocomplete widget does get it correctly as two terms.

    dragonwize’s picture

    Category: bug » feature

    Nope, sorry janusman. This is still a feature request because while AT uses core taxonomy the one thing it does change is how tags are entered by the user hence why that happens. I see that you have commented on #412578: Tags are not submitted if user does not click add as well. That is good as that is where it will be decided.

    janusman’s picture

    Let me attempt a different explanation of what I'm seeing (maybe this is not the correct issue to report this, seemed related) =)

    1) Core drupal install, and an autocomplete taxonomy (tags) vocabulary.
    2) Create a single new node, and enter this in the autocomplete field:

    "Emerson, Lake and Palmer", The Cure

    3) Save node
    4) Two terms are created: one for Emerson, Lake and Palmer, and one for The Cure.
    5) Now, install, enable, configure Active Tags module
    6) Edit above node. The active tags (incorrectly) shows 4 tags for the node:
    "Emerson,
    Lake
    and Palmer"
    The Cure

    .. however I have not modified nor yet edited the node. There are still 2 terms in the vocabulary since the node has not been saved, and the term_node table (of course) shows there are two terms assigned to this node.

    7) If you save the above node, changes are permanent.

    What's happening is the Javascript regular expression is splitting the terms incorrectly.

    So, uhm maybe the above should go into a new issue instead of this one =) If so, I apologize for changing the category without asking first.

    Thanks btw =)

    dragonwize’s picture

    @janusman: That would be a different issue. Please open a ticket with that information.

    ck9’s picture

    Please implement this feature! +1 vote

    I have been trying to find a way to make freetagging ignore commas and to treat them like ordinary text. I thought this module was the answer but it still treats comma separated strings as separate items.

    e.g. "School of Arts, Languages, and Literature"
    should be a single term not three.

    arhak’s picture

    Status: Active » Needs review
    StatusFileSize
    new3.52 KB

    I haven't try it, but I implemented a module which adds support for single free tagging
    If this module relies on taxonomy module to handle the way each vocabulary works, then installing this module and setting up the desired vocabulary to be "Tag (single select)" should do the treak

    taxonomy_single_tag is far a way from being a hack, since it integrates gracefully with taxonomy delegating main functionality to it, therefore, preserving i18n support

    Note: I fixed the module to remove depending on apix_install (which is another module of my own)

    dragonwize’s picture

    Status: Needs review » Closed (fixed)

    I've gone forward with this made entries including commas as single terms.

    Patch including this feature is being reviewed here: #559176: Upon enabling, existing tags with commas inside quotes split incorrectly.

    ohthehugemanatee’s picture

    +1 for this, or we could just have taxonomy-single-tag as a module.

    arhak’s picture

    taxonomy_single_tag is now a project

    EDIT: link fixed