Edgewall Software
Modify

Opened 14 years ago

Closed 6 years ago

#9274 closed defect (fixed)

Using a '#' in a custom field names breaks saved custom queries.

Reported by: blynch1@… Owned by:
Priority: normal Milestone:
Component: query system Version: 0.11.3
Severity: minor Keywords: bitesized
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I will apologize in advance if this is covered elsewhere, I searched, but could not find a ticket.

I'm using Trac 0.11.3 (with a few variances, and a few selected updates from newer versions of trac)

I have a custom field with a # in the name. (eg: Test #)

I ran a custom query that uses this field name as a column (&col=Test+#)

When I run the custom query, I have no problem, the report returns what I expect.

Then I save the report, and load it. Of the columns I want displayed, only a few display.

What I noticed was, upon running the custom query for the first time, the url has &col=Test+%23 (so, the # is converted into something a bit more url safe), but the url, when loading the saved query, has &col=Test+#, meaning the # was not converted.

I can of course get past this by 1. changing the name of my field, or 2. modifying the saved custom query to store &col=Test+%23

Attachments (0)

Change History (3)

comment:1 by Christian Boos, 14 years ago

Keywords: bitesized added
Milestone: next-major-0.1X
Severity: normalminor

You should indeed use testnr as the custom field name, and specify Test # as the descriptive label:

[ticket-custom]
testnr = text
testnr.label = Test #

See TracTicketsCustomFields#AvailableFieldTypesandOptions.

As we already blacklist reserved names when considering custom field names, we should perhaps also complain when forbidden characters are used in those names.

comment:2 by Oleh_O, 11 years ago

Looks like this bug is already closed. Log already gives a warning: Trac[api] WARNING: Invalid name for custom field: "test_field #" (ignoring)

comment:3 by Jun Omae, 6 years ago

Component: report systemquery system
Milestone: next-major-releases
Resolution: fixed
Status: newclosed

Name of custom field must be matched with ^[a-zA-Z][a-zA-Z0-9_]+$. Currently, # cannot be used.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.