From 4d7f039f1a11c18d531ee5906dbc97b2c60a2c77 Mon Sep 17 00:00:00 2001 From: Bert Burgemeister Date: Mon, 14 May 2012 13:08:57 +0200 Subject: [PATCH] Fix bug where user-points couldn't have NULL aux values --- phoros.asd | 2 +- phoros.lisp | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/phoros.asd b/phoros.asd index 01549c7..eb8dc7a 100644 --- a/phoros.asd +++ b/phoros.asd @@ -21,7 +21,7 @@ interface. http://phoros.boundp.org" ;; There should be a corresponding git tag which marks the point this ;; version number becomes official. - "13.2.2" + "13.2.3" :licence ;goes with --licence output "Copyright (C) 2010, 2011, 2012 Bert Burgemeister diff --git a/phoros.lisp b/phoros.lisp index 4cdb989..d563077 100644 --- a/phoros.lisp +++ b/phoros.lisp @@ -823,13 +823,13 @@ ingredients for the URLs of the 256 nearest images." (point-form (format nil "SRID=4326; POINT(~S ~S ~S)" 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-numeric (if aux-numeric-raw - (apply #'vector aux-numeric-raw) + (nullify-nil (apply #'vector aux-numeric-raw)) :null)) (aux-text (if aux-text-raw - (apply #'vector aux-text-raw) + (nullify-nil (apply #'vector aux-text-raw)) :null)) (user-point-table-name (user-point-table-name presentation-project-name))) @@ -1224,7 +1224,14 @@ coordinates received, wrapped in an array." ((symbolp x) 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 (aux-local-linestring :uri "/phoros/lib/aux-local-linestring.json" :default-request-type :post) -- 2.11.4.GIT