about summary refs log tree commit diff
path: root/web/panettone/src/util.lisp
diff options
context:
space:
mode:
authorAspen Smith <root@gws.fyi>2024-03-31T20·06-0400
committerclbot <clbot@tvl.fyi>2024-03-31T20·58+0000
commit1d1984e85f29e5af686241208a458b5531750169 (patch)
treec21b52ffa05ba1f03276c58ac96a60a2379785ab /web/panettone/src/util.lisp
parentefe7e8e63abfc7589244541c7e7cf3dbb0ba66bf (diff)
fix(web/panettone): Hotfixes for full text search change r/7834
- Actually define *static-dir* at build time, to get the search.png in
  the search box
- Better logging for migration running at startup time
- Fix and-where to properly exclude nil clauses
- fix looking up build-time vars in the :build package

Change-Id: Ia2ef3b2715d4c2efb62bbb2c72084f0f0ad09562
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11325
Autosubmit: aspen <root@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Diffstat (limited to 'web/panettone/src/util.lisp')
-rw-r--r--web/panettone/src/util.lisp7
1 files changed, 4 insertions, 3 deletions
diff --git a/web/panettone/src/util.lisp b/web/panettone/src/util.lisp
index c9d86cbfb32d..4c3c4f1aa692 100644
--- a/web/panettone/src/util.lisp
+++ b/web/panettone/src/util.lisp
@@ -16,8 +16,9 @@ that it can be successfully decoded by the `BASE64' package"
 
 (defun and-where (clauses)
   "Combine all non-nil clauses in CLAUSES into a single S-SQL WHERE form"
-  (if (null clauses) t
-      (reduce (lambda (x y) `(:and ,x ,y)) clauses)))
+  (let ((clauses (remove nil clauses)))
+    (if (null clauses) t
+        (reduce (lambda (x y) `(:and ,x ,y)) clauses))))
 
 (defun and-where* (&rest clauses)
   "Combine all non-nil clauses in CLAUSES into a single S-SQL WHERE form"
@@ -27,7 +28,7 @@ that it can be successfully decoded by the `BASE64' package"
     (name value-if-not-in-build &optional (doc nil))
   `(defvar ,name
      (or (when-let ((package (find-package :build)))
-           (let ((sym (find-symbol ,(symbol-name name))))
+           (let ((sym (find-symbol ,(symbol-name name) package)))
              (when (boundp sym) (symbol-value sym))))
          ,value-if-not-in-build)
      ,doc))