]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/amf_controller.rb
Adding some amf create poi tests. Minor bugfix tweaks to the amf controller
[rails.git] / app / controllers / amf_controller.rb
index e9bcb281b027f1719a74ea768e4e8f0c64b2b252..9c9f85e1dda3e47efda55c553e0b1674971b74d3 100644 (file)
@@ -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