When tagging a node with tags containing commas, autocomplete removes double-quotes around previously entered tags.

How to simulate problem:
1) Create terms "term, 1" and "term, 2" so that autocomplete can offer them.
2) Try to tag a node with both terms using autocomplete
2.1) When the textfield contains "term, 1" and you append , ter the autocomplete offers term, 2 and others
2.2) Click the offered term, 2
3) The first tag looses double-quotes, splitting into 2 tags term and 1

Expected behavior:
Autocomplete appends "term, 2" and leaves previous tags untouched (in double-quotes).

Current behavior:
Autocomplete appends "term, 2" but changes the original content of the textfield so that double-quotes get lost.

Comments

BayerMeister’s picture

I think it is here:
taxonomy.pages.inc:124:

    $prefix = count($array) ? implode(', ', $array) .', ' : '';

This line concatenates the previous terms, but does not enclose them in double quotes even if needed (array of terms contains terms with commas or double-quotes inside).

I'll try to make a patch and append it here. I'll be glad to get directions on how to get this into the next update and how to make sure it gets fixed in D7 (which I don't use yet) as well.

BayerMeister’s picture

Status: Active » Needs review
StatusFileSize
new873 bytes

Here is a patch. No magic there, just surrounding terms with double-quotes and doubling double-quotes in them.

I tested it and it works. Should have no side effect.

Now I'd appreciate some guidance. What now?

Status: Needs review » Needs work

The last submitted patch, taxonomy.pages_.inc_.patch, failed testing.

BayerMeister’s picture

Status: Needs work » Needs review
StatusFileSize
new838 bytes

Ups. I'm sorry :-/ My first patch and I did it backwards. Here this one should be OK.

BayerMeister’s picture

StatusFileSize
new820 bytes

...and with UNIX line endings...

Status: Needs review » Needs work

The last submitted patch, tagging.patch, failed testing.

BayerMeister’s picture

Version: 6.20 » 6.x-dev
Status: Needs work » Needs review
StatusFileSize
new889 bytes

Last attempt. I downloaded the latest sources, followed steps in http://drupal.org/patch/create, used GNU diff.
It is a hard thing to contribute simple things it seems :-)
If it doesn't pass now, I'll let someone else apply it. I think the .patch file is OK.

Status: Needs review » Needs work

The last submitted patch, tagging2.patch, failed testing.

BayerMeister’s picture

Status: Needs work » Needs review
StatusFileSize
new881 bytes

Changed name of patched file back to original, so that SimpleTest recognizes which file this is about.

BayerMeister’s picture

StatusFileSize
new846 bytes

Cleaned paths so that they are relative to drupal root.

Status: Needs review » Needs work

The last submitted patch, tagging2.patch, failed testing.

BayerMeister’s picture

Version: 6.x-dev » 7.x-dev
Status: Needs work » Needs review
StatusFileSize
new679 bytes

The bug exists still in D7 and should be later backported.

itamair’s picture

#12: tagging.patch queued for re-testing.

itamair’s picture

With that patch applied, still terms separated with commas don't show in autocomplete list ...

This issue would really need a fix. Please ...

mr.baileys’s picture

Status: Needs review » Closed (duplicate)