[OpenStreetMap] #4471: Attempt to remove all members from a relation is silently ignored
OpenStreetMap
trac at openstreetmap.org
Wed Jul 4 14:28:44 BST 2012
#4471: Attempt to remove all members from a relation is silently ignored
----------------------+-----------------------------------------------------
Reporter: woodpeck | Owner: rails-dev@…
Type: defect | Status: new
Priority: minor | Milestone:
Component: api | Version:
Keywords: |
----------------------+-----------------------------------------------------
An attempt to remove all members from a relation (by uploading a new
version with no members) results in no change - the relation will be
updated with a new version and new user/last modification data, but it
will still have all its members.
Simple test case (modify object/changeset IDs accordingly):
{{{
<osmChange version="0.6">
<create>
<node id="-1" lat="45.0809152" lon="-87.6450209" changeset="zzz"
visible="true" timestamp="2012-05-10T23:28:27Z" version="1"/>
<relation id="-2" visible="true" timestamp="2012-05-12T23:47:18Z"
version="1" changeset="zzz">
<member type="node" ref="-1" role="x"/>
</relation>
</create>
</osmChange>
}}}
later
{{{
<osmChange version="0.6">
<modify>
<relation id="xxx" visible="true" timestamp="2012-05-12T23:47:18Z"
version="1" changeset="zzz" />
</modify>
</osmChange>
}}}
this results in
{{{
<diffResult version="0.6" generator="OpenStreetMap server">
<relation old_id="xxx" new_id="xxx" new_version="2"/>
</diffResult>
}}}
but the relation is unchanged!
It is possible that the bug is related to the "unless @members"
https://github.com/openstreetmap/openstreetmap-
website/blob/master/app/models/relation.rb#L164 but I cannot say for sure.
The bug can be circumvented by deleting a relation (which will clear the
member list) and then undeleting it through a <modify>.
Relations without members should be allowed even though their uses are
probably niche cases.
--
Ticket URL: <https://trac.openstreetmap.org/ticket/4471>
OpenStreetMap <http://www.openstreetmap.org/>
OpenStreetMap is a free editable map of the whole world
More information about the rails-dev
mailing list