Edgewall Software

Ticket #4136 (new defect)

Opened 2 years ago

Last modified 3 months ago

Can not query values that contain & (ampersand) characters

Reported by: steffenp@… Owned by: cboos
Priority: normal Milestone: 0.12
Component: ticket system Version: 0.10
Severity: minor Keywords: query
Cc:

Description

It is not possible to search for values that contain characters used as separators in the query language such as & or |.

Example: If a milestone is named "x&y" the corresponding query [query:milestone=x&y] will result in an error:

[Error: Query filter requires field and constraints separated by a "="]

The TracQuery language needs to support escaping.

Attachments

Change History

Changed 2 years ago by cboos

  • owner changed from jonas to cboos
  • severity changed from normal to minor
  • milestone set to 0.11

The "!" character used for escaping is already used there to express negation, so I think it's not an option.

So I propose to use "\", with "\\" being used to escape "\" itself.

Changed 22 months ago by ThurnerRupert

the gui query interface for milestones like this is also broken (in 0.10-3dev at least):

if you add milestones to criteria, the milestone dropdown contains "x&y", which gets translated to %26amp;y if you select it, so no result.

but the the result page contains then a correct drop down with "x&y" and then it works.

Changed 21 months ago by anonymous

milestones with a space in it won't work in queries either.

For example:

MPEG4 in MP4" Overzicht defecten

Changed 21 months ago by anonymous

The query above was:

[query:type=defect&milestone="Video-opslag: MPEG4 in MP4" Overzicht defecten]

Changed 21 months ago by cboos

For quoting spaces, this should be:

[query:"type=defect&milestone=Video-opslag: MPEG4 in MP4" Overzicht defecten]

Overzicht defecten

as explained in TracLinks#QuotingspaceinTracLinks.

As for escaping the characters used in the Query syntax, there's been no other proposal than using the backslash, so I'll go for that.

Changed 3 months ago by cboos

  • keywords query added
  • milestone changed from 0.11.2 to 0.12

Add/Change #4136 (Can not query values that contain & (ampersand) characters)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from cboos. Next status will be 'new'
The owner will change from cboos to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.