Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3910 closed defect (fixed)

Potlatch2 and long value handling

Reported by: SomeoneElse Owned by: potlatch-dev@…
Priority: minor Milestone:
Component: potlatch2 Version:
Keywords: Cc:

Description

If an attempt is made to save a node with a value that's too long, this message is displayed:

An unexpected error occurred, probably due to a bug in Potlatch 2. Do you want to retry? (The server said: NodeTag? 1364231671: v: is too long (maximum is 255 characters) ("<extensions xmlns=\"http://www.topografix.com/GPX/1/1\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <gpxx:WaypointExtension xmlns:gpxx=\"http://www.garmin.com/xmlschemas/GpxExtensions/v3\">\n <gpxx:DisplayMode>SymbolAndName?</gpxx:DisplayMode>\n </gpxx:WaypointExtension>\n</extensions>"))

There's a yes/no box below - yes seems to mean "try again" and no means "don't". After clicking "no" you do get a "view data" option showing the osmchange xml but that's probably not a lot of use for newbies.

To see the problem try this: http://www.openstreetmap.org/edit?editor=potlatch2&gpx=1056198

Zoom in and convert the orange dot north of the road to a node and try and save it.

In this case the extra-long value is created by a Garmin GPS. There are other long value trac bugs related to merged Tiger data (3846 open and 3587 closed) but this is a different aspect of the problem.

Edits can be lost due to this problem if you've done a lot of edits prior to a save and don't know where the offending waypoint that's causing the problem actually is.

Among the possible solutions are:

1) Filter "extensions" from the list of tags moved from the waypoint to the node (Potlatch 1 does this) - that would solve the issue I'm seeing with Garmin data but wouldn't affect the problem if someone found another way to cause it.

2) Position the user in the editor to the first offending item and allow them to edit it manually (harder, and might be time consuming if lots of items have the problem).

Change History (3)

comment:1 Changed 8 years ago by stevage

3) Truncate all values at 255 characters on save

4) Skip any objects with values containing more than 255 characters, then warn the user about the problem (so avoiding the "lose unrelated data" problem...)

comment:2 Changed 8 years ago by Richard

Resolution: fixed
Status: newclosed

Manually entered tag values are truncated at 255 characters anyway; this is only an issue with imported values (as in this case, from a GPX). Fixed in https://github.com/systemed/potlatch2/commit/df37a02d49c8e9266ca44e69389dfb566b82e819 .

comment:3 Changed 8 years ago by SomeoneElse

Thanks - tested and working here.

Note: See TracTickets for help on using tickets.