Modify

Opened 16 years ago

Closed 16 years ago

#637 closed defect (fixed)

[PATCH] JOSM allows duplicate members in relations

Reported by: rvollmert@… Owned by: anonymous
Priority: major Milestone:
Component: Core Version:
Keywords: relations Cc:

Description

You can add a given way twice to a relation in JOSM with the same role with no problem, but the API doesn't accept this (500). This happened to me with a route relation (role="").

The best solution would probably be to silently discard duplicate entries (so you don't have to worry to select only ways that are not in the relation yet).

The problem is compounded by the fact that visual feedback when adding members to a relation is slim , and that the error on failed upload is misleading, stating a timeout. I will file a separate tickets for these.

Attachments (1)

nodoubleadd.diff (824 bytes ) - added by stoecker 16 years ago.
Do no longer add an existing element

Download all attachments as: .zip

Change History (8)

comment:1 by rvollmert@…, 16 years ago

I've since found out that error 500 is a bug in the API, so maybe JOSM isn't at fault?

comment:2 by framm, 16 years ago

Owner: changed from framm to anonymous
Status: newassigned

No, JOSM should really not allow the same member twice. However this should probably be checked when you click Ok and not when you "add selected", as you might want to add something twice and THEN adjust the roles to make the situation legal.

comment:3 by smsm1, 16 years ago

Due to

add_index "relation_members", ["member_type", "member_id"], :name => "relation_members_member_idx"

in the schema, that won't make it legal.

You can only have a node, way or relation once in each relation.

http://trac.openstreetmap.org/ticket/718 is the ticket for getting the api to return precondition_failed instead of a sever error.

comment:4 by smsm1, 16 years ago

JOSM doesn't recognise a 412 precondition failed when a relation is uploaded.

comment:5 by schusch, 16 years ago

see #782 for this bug too

by stoecker, 16 years ago

Attachment: nodoubleadd.diff added

Do no longer add an existing element

comment:6 by stoecker, 16 years ago

Summary: JOSM allows duplicate members in relations[PATCH] JOSM allows duplicate members in relations

Patching the problem by no longer adding elements multiple times.

comment:7 by framm, 16 years ago

Resolution: fixed
Status: assignedclosed

Patch applied for r669.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain anonymous.
as The resolution will be set.
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.