publiclab / mapknitter

Upload your own aerial images, position (rubbersheet) them in a web interface over existing map data, and share via web or composite and export for print.
http://mapknitter.org
GNU General Public License v3.0
267 stars 207 forks source link

undefined method `zero?' for nil:NilClass on creating new map with no coordinates selected #1695

Closed sentry-io[bot] closed 2 years ago

sentry-io[bot] commented 2 years ago

Sentry Issue: MAPKNITTER-4F

NoMethodError: undefined method `zero?' for nil:NilClass
  lib/not_at_origin_validator.rb:13:in `null_island?'
    record.lat.zero? || record.lon.zero?
  lib/not_at_origin_validator.rb:7:in `validate'
    if null_island?(record) && record.created_at > DateTime.new(2015, 1, 13, 0, 0, 0)
  app/controllers/maps_controller.rb:48:in `create'
    if @map.save
...
(123 additional frame(s) were not displayed)
jywarren commented 2 years ago

Added a nil check at https://github.com/publiclab/mapknitter/commit/219804a44db56c94a651c89490f274229e0873c1

However, we also see this in the browser:

Uncaught TypeError: $(...).autocomplete is not a function
    at HTMLDocument.<anonymous> (new:211:22)
    at h (application-da8857872a5d85b4bb36004b160051dbf5d4c77ab3d9a8e9a9b99504e2d6c978.js:6:23859)
    at p (application-da8857872a5d85b4bb36004b160051dbf5d4c77ab3d9a8e9a9b99504e2d6c978.js:6:24162)

That's at:

https://github.com/publiclab/mapknitter/blob/4331ef0b2873a3cf53007023d52c2515d93f1e63/app/views/maps/_geocoder.js.erb#L15

jywarren commented 2 years ago

Fixing with re-addition of jquery-ui in https://github.com/publiclab/mapknitter/pull/1696