Ticket #9558 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

[Patch] Keywords containing single quotes break autocomplete

Reported by: rjollos Assigned to: rjollos
Priority: normal Component: KeywordSuggestPlugin
Severity: normal Keywords:
Cc: itamarost, hasienda Trac Release: 0.11

Description (Last modified by rjollos)

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

keywordsuggestplugin-9558-itamaro-v1.patch (2.6 kB) - added by itamarost on 11/26/11 13:13:33.
fix single-quote issue

Change History

11/25/11 02:53:50 changed by rjollos

  • owner changed from scratcher to rjollos.

11/25/11 02:57:09 changed by rjollos

  • description changed.

11/25/11 03:00:02 changed by rjollos

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.

11/26/11 13:13:33 changed by itamarost

  • attachment keywordsuggestplugin-9558-itamaro-v1.patch added.

fix single-quote issue

(follow-ups: ↓ 6 ↓ 7 ) 11/26/11 13:16:32 changed by itamarost

  • summary changed from Trac 0.12 support to [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.

11/27/11 08:23:19 changed by rjollos

Thanks for the new patch. I hope to get it committed to the repository tomorrow.

(in reply to: ↑ 4 ) 12/01/11 02:46:03 changed by rjollos

  • status changed from new to 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.

(in reply to: ↑ 4 ; follow-up: ↓ 9 ) 12/01/11 02:51:33 changed by rjollos

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.

12/01/11 02:53:18 changed by rjollos

  • status changed from assigned to closed.
  • resolution set to fixed.

(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.

(in reply to: ↑ 7 ) 12/01/11 06:51:25 changed by anonymous

Replying to rjollos:

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.

Definitely a better solution. I was not aware of that util function.


Add/Change #9558 ([Patch] Keywords containing single quotes break autocomplete)




Change Properties
Action