Index: openacs-4/packages/attachments/tcl/attachments-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/tcl/attachments-procs.xql,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/attachments/tcl/attachments-procs.xql 30 Aug 2002 14:44:08 -0000 1.3
+++ openacs-4/packages/attachments/tcl/attachments-procs.xql 19 Jun 2018 15:55:27 -0000 1.4
@@ -55,19 +55,14 @@
-
-
- select approved_p
- from attachments
- where object_id = :object_id
- and item_id = :item_id
-
-
-
update attachments
- set approved_p = :approved_p
+ set approved_p = (
+ case when :approved_p is not null
+ then :approved_p
+ else not approved_p
+ end)
where object_id = :object_id
and item_id = :item_id