Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2032 closed enhancement (fixed)

Railsport's GPS upload dialog gives an error on comma-delimeted tags

Reported by: avar Owned by: Tom Hughes
Priority: minor Milestone:
Component: website Version:
Keywords: Cc: StefanB

Description

"foo, bar" gives an error, "foo bar" doesn't.

The error message doesn't indicate *why* the user was in error.

The code should just split on /[,\s]+/.

Change History (12)

comment:1 Changed 10 years ago by Tom Hughes

It's in error because tags are sometimes included in URLs and hence any URL special characters are excluded and that includes comma. Splitting is, and always has been, on whitespace not on commas.

comment:2 Changed 10 years ago by avar

Whatever it ends up accepting the error message should indicate what sort of input is acceptable.

comment:3 Changed 10 years ago by StefanB

otoh, splitting by commas would allow entering tags with spaces.

eg "New York" tag (as on ground!) is much better as a single tag than 2 separate tags "New" and "York" or artificially joined tag ("NewYork?" or "New_York")

comment:4 Changed 10 years ago by StefanB

Cc: StefanB added

comment:5 Changed 10 years ago by Tom Hughes

Not splitting on spaces would be non-backwards compatible of course and might confuse people used to the old behaviour.

comment:6 Changed 10 years ago by StefanB

Splitting by commas would be employed only if commas are present, otherwise splitting by spaces for backwards compatibility (commas are not allowed now, so introducing them doesn't break anything).

In track editing mode tags could be safely shown with commas.

comment:7 in reply to:  6 Changed 10 years ago by StefanB

Replying to StefanB:

Splitting by commas would be employed only if commas are present, otherwise splitting by spaces for backwards compatibility (commas are not allowed now, so introducing them doesn't break anything).

The problem would only remain when user enters a single two (or more) word tag (eg "New York") as the system would split it into two tags, but that is exactly what is happening now already.

In track editing mode tags could be safely shown with commas.

Also in track details view of course.

comment:8 Changed 10 years ago by Tom Hughes

Priority: majorminor
Type: defectenhancement

comment:9 Changed 10 years ago by StefanB

Does this mean proposed design is acceptable?

I guess same behaviour should be implemented in API? http://wiki.openstreetmap.org/wiki/OSM_Protocol_Version_0.6#Uploading_Traces only says: tags: A string containing tags for the trace. Nothing about delimiters.

comment:10 Changed 10 years ago by stefanb

Resolution: fixed
Status: newclosed

(In [16373]) Introducing comma as tag separator (if present, otherwise it behaves as before), allowing spaces in tags. fixes #2032

comment:11 Changed 10 years ago by StefanB

I didn't test the /api/0.6/gpx/create API call, but it _should_ behave the same as uploading traces via web (which works fine)

comment:12 Changed 10 years ago by StefanB

tnx for polishing it up in [16376], i suspected there was some magic to do it more elegantly :)

#216 suggests some instructions about filling it in, but it seems intuitive enough to me (and some other users, as it seems). It'd probably be more useful for people that are used to old way of entering tags.

Note: See TracTickets for help on using tickets.