X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0a57413d3e5d3734f2f3d83df00abd861d80aee2..b7b2b502cf2b119208e3c1f79e4a4e38cc0edcc5:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index 1fa433c9e..6e1b364d4 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -135,6 +135,14 @@ class AmfController < ApplicationController # close previous changeset and add comment if closeid + cs = Changeset.find(closeid) + cs.open = false + if closecomment.empty? + cs.save! + else + cs.tags['comment']=closecomment + cs.save_with_tags! + end end # open a new changeset @@ -206,14 +214,13 @@ class AmfController < ApplicationController begin check_boundaries(xmin, ymin, xmax, ymax) rescue Exception => err - # FIXME: report an error rather than just return an empty result - return [[]] + return [-2,"Sorry - I can't get the map for that area."] end nodes_in_area = Node.find_by_area(ymin, xmin, ymax, xmax, :conditions => ["current_ways.visible = ?", false], :include => :ways_via_history) way_ids = nodes_in_area.collect { |node| node.ways_via_history_ids }.flatten.uniq - [way_ids] + [0,way_ids] end # Get a way including nodes and tags.