X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/e9527b363da441337ac8c44c9d3d3feada3eaa9c..67157f69f3b3fb3933207016b2d9566ababf1310:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index e9bcb281b..9c9f85e1d 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -468,7 +468,7 @@ class AmfController < ApplicationController # -- Initialise and carry out checks - user = getuserid(usertoken) + user = getuser(usertoken) if !user then return -1,"You are not logged in, so the way could not be saved." end originalway = originalway.to_i @@ -506,7 +506,8 @@ class AmfController < ApplicationController if renumberednodes[id] id = renumberednodes[id] - elsif id <= 0 + end + if id <= 0 # Create new node savenode = true else @@ -573,7 +574,7 @@ class AmfController < ApplicationController # Save POI to the database. # Refuses save if the node has since become part of a way. - # Returns: + # Returns array with: # 0. 0 (success), # 1. original node id (unchanged), # 2. new node id, @@ -597,6 +598,7 @@ class AmfController < ApplicationController # We always need a new node, based on the data that has been sent to us new_node = Node.new + new_node.id = id new_node.changeset_id = changeset new_node.version = version new_node.lat = lat