From 9fef684c6878bbe8a5795c735f92372addba8388 Mon Sep 17 00:00:00 2001 From: David Botton Date: Tue, 21 Jun 2022 12:43:00 -0400 Subject: [PATCH] replaces existing customer control if already installed --- tools/clog-builder.lisp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/clog-builder.lisp b/tools/clog-builder.lisp index cfc45ab..41c0c17 100644 --- a/tools/clog-builder.lisp +++ b/tools/clog-builder.lisp @@ -261,8 +261,14 @@ create-div's" (find-if (lambda (x) (equal (getf x :name) control-type-name)) *supported-controls*))) (defun add-supported-controls (control-records) - "Add a list of control-records to builder's supported controls." - (alexandria:appendf *supported-controls* control-records)) + "Add a list of control-records to builder's supported controls. If control exists it is +replaced." + (dolist (r control-records) + (setf *supported-controls* + (append (remove-if (lambda (x) + (equal (getf x :name) (getf r :name))) + *supported-controls*) + (list r))))) (defun create-control (parent content control-record uid &key custom-query) "Return a new control based on CONTROL-RECORD as a child of PARENT"