#9558 closed defect (fixed)
[Patch] Keywords containing single quotes break autocomplete
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | KeywordSuggestPlugin |
Severity: | normal | Keywords: | |
Cc: | Itamar Oren, Steffen Hoffmann | Trac Release: | 0.11 |
Description (last modified by )
As originally posted by itamarost in comment:27:ticket:4201:
I ported the patch from this ticket, so it now works for me with Trac-0.12.3dev and TagsPlugin (trunk with patch from #7857).
It populates the autocomplete by merging the keywords trac.ini ListOption
with all existing tags from TagsPlugin, if TagsPlugin is installed (otherwise it just uses the keywords ListOption
).
The autocomplete is also available for wiki-tags when TagsPlugin is installed.
Also fixed on the way a problem with tags that contain a quote (need escaping when embedded in inline JS).
Patch is here.
Attachments (1)
Change History (10)
comment:1 Changed 13 years ago by
Owner: | changed from scratcher to Ryan J Ollos |
---|
comment:2 Changed 13 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 13 years ago by
Changed 13 years ago by
Attachment: | keywordsuggestplugin-9558-itamaro-v1.patch added |
---|
fix single-quote issue
comment:4 follow-ups: 6 7 Changed 13 years ago by
Summary: | Trac 0.12 support → [Patch] Keywords containing single quotes break autocomplete |
---|
I have updated to the latest trunk, with the latest trunk of TagsPlugin, and it worked just fine on my Trac-0.12.3dev.
So I decided to hijack this ticket for a fix that was in my previous patch and got left out - an issue that breaks the autocomplete when a keyword containing a single-quote exists.
In addition, I've noticed that when the TagsPlugin is not installed, this plugin still injects the javascript to wiki_edit, so I tried addressing that as well in the attached patch.
comment:5 Changed 13 years ago by
Thanks for the new patch. I hope to get it committed to the repository tomorrow.
comment:6 Changed 13 years ago by
Status: | new → assigned |
---|
Replying to itamarost:
I have updated to the latest trunk, with the latest trunk of TagsPlugin, and it worked just fine on my Trac-0.12.3dev.
Added the 0.12 tag to the KeywordSuggestPlugin page. Thanks for testing.
comment:7 follow-up: 9 Changed 13 years ago by
Replying to itamarost:
So I decided to hijack this ticket for a fix that was in my previous patch and got left out - an issue that breaks the autocomplete when a keyword containing a single-quote exists.
I'm going to make a minor change to your patch and use javascript_quote
from trac.util.text
rather than replace
. Let me know if you have any comments on this.
comment:8 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [10960]) Fixes #9558: (0.4.3) Patch by itamarost.
- FIX: Keyword with a single quote would break autocomplete because the string was not being correctly escaped.
- FIX: When the TagsPlugin was not installed, javascript was still injected into the wiki edit page.
comment:9 Changed 13 years ago by
Replying to rjollos:
I'm going to make a minor change to your patch and use
javascript_quote
fromtrac.util.text
rather thanreplace
. Let me know if you have any comments on this.
Definitely a better solution. I was not aware of that util function.
itamarost: if you are able to create a patch of the 0.12 changes against the 0.4 version of the plugin that I committed in #4201, I could get the 0.12 compatibility applied fairly soon. Otherwise, I'll probably get to it in a few weeks when finishing up my own Trac 0.12 upgrade.