From 01078adf81ec2e346aa3e8ca02d7fb53302984cc Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Thu, 3 Dec 2009 14:10:31 +0100 Subject: Fix database access when moderating comments and trackbacks. Ignore-this: ab9c17fae83025673a3d8287baadef6c darcs-hash:5958fdbbcc2cd9f9891b4d59d7caa6e0a9897f7d --- main.lisp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.lisp b/main.lisp index a770bcc..99d1b3c 100644 --- a/main.lisp +++ b/main.lisp @@ -157,7 +157,13 @@ (acceptp (getf *query* :acceptp nil)) (table (cond ((string= type "trackback") 'journal_trackback) ((string= type "pingback") 'journal_pingback) - (t 'journal_comment)))) + (t 'journal_comment))) + (class (intern (map 'string (lambda (c) + (case c + (#\_ #\-) + (otherwise c))) + (symbol-name table)) + (find-package "MULK.JOURNAL")))) (with-transaction () (when (and id type acceptp (string= acceptp "t")) (update-records table @@ -166,7 +172,7 @@ ;; Update static files. (update-index-page) (update-comment-feed) - (let ((comment/trackback (single-object (select table + (let ((comment/trackback (single-object (select class :where [= [id] id] :flatp t)))) (update-journal-entry-page (entry-of comment/trackback)))) -- cgit v1.2.3