Hi,
There is a trivial bug in taxonomy_autocomplete (modules/taxonomy/taxonomy.pages.inc), that makes it impossible to autocomplete terms containing a comma or quotes.
If you want to reproduce, add a autocomplete free-tagging field to a entity, save it with a value like "work, this doesn't", save. The term is created. Try to create a new entity, enter in "work" - the term isn't autocomplete like it should.
The reason for this is that terms are only added to the list of term_matches, iff it isn't necessary to quote the term before returning it. The term should always be added, even if it needed quoting.
Comments
Comment #1
fangel commentedAnd here's the patch to correct the problem.
Comment #2
joachim commentedThis has already been reported, and there's a patch at #1000736: Term reference autocomplete widget having problems handling terms with commas.
Can you compare that one and yours please?
Comment #3
fangel commentedSorry, I tried looking for existing issues but I must have missed it. That issue contains my fix + another part I had missed.
Comment #4
joachim commentedNo problem; happens to us all :)
Any chance you have time to review that other patch?
Comment #5
mattbk commentedI am having the same problems even after upgrading to 7.8. I have checked the files and the patch (from the other issue) seems to have been committed. I have run cron and cleared caches. fangel, are you still having problems?
EDIT: To clarify, I am only having autocomplete issues when exposing a term field in Views. Would this comment be better off in the Views issue queue?
Comment #6
fangel commentedmattbk: Yes, the issue still remains in Views - but this is a Views bug, not a Drupal Core one (more specifically, it's a bug in views_ajax_autocomplete_taxonomy)
Comment #7
fangel commentedmattbk: I've created an issue in the Views issue-queue with a patch that should fix the problem - care to check it out? #1278694: Unable to autocomplete terms containing commas or quotes.
Comment #8
mattbk commentedI can confirm that the patch at #1278694: Unable to autocomplete terms containing commas or quotes. works.
Comment #9
mrded commentedI caught this problem again on fresh Drupal 7.23 installation.
Steps to Reproduce:
Actual Results: Widget will wrap each quote to another quotes.
Expected Results: Widget should insert term's name without extra quotes.
Please, take a look the video: http://d.pr/v/rk6y
Comment #10
mrded commentedSorry, I misunderstood this issue. After submit it works how it should be.