Skip to content

Commit

Permalink
Fix bug where user-points couldn't have NULL aux values
Browse files Browse the repository at this point in the history
  • Loading branch information
trebb committed May 14, 2012
1 parent f87358e commit 4d7f039
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion phoros.asd
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface. http://phoros.boundp.org"
;; There should be a corresponding git tag which marks the point this ;; There should be a corresponding git tag which marks the point this
;; version number becomes official. ;; version number becomes official.


"13.2.2" "13.2.3"


:licence ;goes with --licence output :licence ;goes with --licence output
"Copyright (C) 2010, 2011, 2012 Bert Burgemeister "Copyright (C) 2010, 2011, 2012 Bert Burgemeister
Expand Down
15 changes: 11 additions & 4 deletions phoros.lisp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -823,13 +823,13 @@ ingredients for the URLs of the 256 nearest images."
(point-form (point-form
(format nil "SRID=4326; POINT(~S ~S ~S)" (format nil "SRID=4326; POINT(~S ~S ~S)"
longitude latitude ellipsoid-height)) longitude latitude ellipsoid-height))
(aux-numeric-raw (cdr (assoc :aux-numeric data))) (aux-numeric-raw (setf *t* (cdr (assoc :aux-numeric data))))
(aux-text-raw (cdr (assoc :aux-text data))) (aux-text-raw (cdr (assoc :aux-text data)))
(aux-numeric (if aux-numeric-raw (aux-numeric (if aux-numeric-raw
(apply #'vector aux-numeric-raw) (nullify-nil (apply #'vector aux-numeric-raw))
:null)) :null))
(aux-text (if aux-text-raw (aux-text (if aux-text-raw
(apply #'vector aux-text-raw) (nullify-nil (apply #'vector aux-text-raw))
:null)) :null))
(user-point-table-name (user-point-table-name
(user-point-table-name presentation-project-name))) (user-point-table-name presentation-project-name)))
Expand Down Expand Up @@ -1224,7 +1224,14 @@ coordinates received, wrapped in an array."
((symbolp x) x) ((symbolp x) x)
(t (map (type-of x) #'nillify-null x)))) (t (map (type-of x) #'nillify-null x))))



(defun nullify-nil (x)
"Replace occurences of nil in nested sequence x by :null."
(cond ((null x) :null)
((stringp x) x)
((numberp x) x)
((symbolp x) x)
(t (map (type-of x) #'nullify-nil x))))

(hunchentoot:define-easy-handler (hunchentoot:define-easy-handler
(aux-local-linestring :uri "/phoros/lib/aux-local-linestring.json" (aux-local-linestring :uri "/phoros/lib/aux-local-linestring.json"
:default-request-type :post) :default-request-type :post)
Expand Down

0 comments on commit 4d7f039

Please sign in to comment.