Modify

Opened 10 years ago

Closed 9 years ago

#11950 closed defect (fixed)

The tag TracLink doesn't allow trailing arguments

Reported by: Ryan J Ollos Owned by: Steffen Hoffmann
Priority: normal Component: TagsPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

When using the wiki TracLink I can append a query string: wiki:TracGuide@2?action=diff. Note that wiki:TracGuide?action=diff also works, showing the diff between the latest and previous revision.

I tried to use tag:license?wiki=on: tag:license?wiki=on?. Since it doesn't work, the alternative is to use: [/tags/license?wiki=on]: tags/license.

I suppose the challenge with tag:license?wiki=on? is that we can't know whether the ? is part of the tag name or the start of a query string. Maybe there is a better way to limit the search using the tag TracLink?

Attachments (0)

Change History (8)

comment:1 Changed 10 years ago by Steffen Hoffmann

Seems like there is a problem with tags query (regression?), because tags:'license realm:wiki' is valid query syntax and should even be preferred over the query string syntax.

comment:2 Changed 10 years ago by Steffen Hoffmann

Type: enhancementdefect

Maybe this was not advertised, but I feel this should still work for consistency. After all you provided a valid use case for realm selection in tag links.

comment:3 Changed 10 years ago by Steffen Hoffmann

In 14148:

TagsPlugin: Fix tags link resolver for tag query expressions, refs #11950.

comment:4 in reply to:  description ; Changed 10 years ago by Steffen Hoffmann

Replying to rjollos:

Maybe there is a better way to limit the search using the tag TracLink?

I think that supporting tag query syntax with 'realm:<realm>' attributes in tag links is consistent and rather straight-forward. Do you agree?

Btw, I've tweaked the tag link rendering to indicate zero-result tag queries too. Isn't that nice? :-)

comment:5 in reply to:  4 ; Changed 10 years ago by Ryan J Ollos

Replying to hasienda:

Replying to rjollos:

Maybe there is a better way to limit the search using the tag TracLink?

I think that supporting tag query syntax with 'realm:<realm>' attributes in tag links is consistent and rather straight-forward. Do you agree?

It does the job so that is good. The syntax is a bit different than anything that is used in the core. That isn't meant negatively, since it's good to consider ways to expand the syntax, and if we find something that works well it could be used in the core (see for example trac:#11731).

Btw, I've tweaked the tag link rendering to indicate zero-result tag queries too. Isn't that nice? :-)

Are you referring to a change in [14148]? I'm afraid I don't see what you are referring to.

I have a few other related comments about TracLinks, but I'll have to save those for tomorrow when I can better organize my thoughts. I had a suggestion for a small refactoring, so I opened another ticket for that: #11968.

comment:6 in reply to:  5 Changed 10 years ago by Steffen Hoffmann

Replying to rjollos:

Replying to hasienda:

Replying to rjollos:

Maybe there is a better way to limit the search using the tag TracLink?

I think that supporting tag query syntax with 'realm:<realm>' attributes in tag links is consistent and rather straight-forward. Do you agree?

It does the job so that is good. The syntax is a bit different than anything that is used in the core. That isn't meant negatively, since it's good to consider ways to expand the syntax, and if we find something that works well it could be used in the core (see for example trac:#11731).

I know, that current tag query syntax is different from anything in Trac core, where you get used to equal-sign expressions, but OTOH it is explained on /tags right below the input field for ages. The question-mark is leaning towards parameter suffixed URLs, and the '<realm>=on' can be deduced from URLs generated by the plugin itself, but it is undocumented, hence not guaranteed to work forever. Only support pipe-list expressions like realm=ticket|wiki, where you need to write today realm:ticket or realm:wiki would make me change my mind.

Btw, I've tweaked the tag link rendering to indicate zero-result tag queries too. Isn't that nice? :-)

Are you referring to a change in [14148]? I'm afraid I don't see what you are referring to.

Yes, indeed. You'll find the relevant change, if you look closer. I had to preserve the query string for conditional formatting, that will switch to 'missing' class, if there is neither a tag nor a query match found for the tag link expression. A dedicated unit test for this feature plus some user documentation in the wiki would be much better than advertising in changeset commit message and changelog file, I know. Will try to make that available before tractags-0.8 release, that I'm pushing towards.

comment:7 Changed 10 years ago by Steffen Hoffmann

In 14158:

TagsPlugin: Test generator for emptyness instead of totally consuming it, refs #3624 and #11950.

Made it just as light as needed for something like a formatter method.

comment:8 Changed 9 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 14945:

0.8: Tag 0.8 release

Fixes #1304, #1344, #3660, #3891, #9064, #9797, #11661, #11690, #11695, #11888, #11950, #11954, #11968, #12202, #12292, #12434, #12486.

Refs #12415.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.