Home
The Toolkit for Online Communities
17361 Community Members, 1 member online, 2274 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Development : title attribute in both acs_objects and cr_revisions : One Message

Forum OpenACS Development: Re: title attribute in both acs_objects and cr_revisions

Collapse
Posted by Stan Kaufman on
Altering content::attribute_insert_statement thus:

Index: cms/tcl/form-procs.tcl
===================================================================
RCS file: /cvsroot/openacs-4/packages/cms/tcl/form-procs.tcl,v
retrieving revision 1.27
diff -u -r1.27 form-procs.tcl
--- cms/tcl/form-procs.tcl      17 May 2005 21:25:08 -0000      1.27
+++ cms/tcl/form-procs.tcl      6 Oct 2005 16:30:00 -0000
@@ -807,7 +807,7 @@
                 }
             }
             
-            if { ! [string equal $value {} ] } {
+            if { ! [string equal $value {} ] && [lsearch -exact $columns $attribute_name] == -1 } {
                 ns_set put $bind_vars $attribute_name $value
 
                 lappend columns $attribute_name

eliminates the error. This is quite a kludge, though, as it simply takes the first attribute it gets -- and in this case uses the version of title from cr_revisions instead of acs_objects. Since they're the same, this doesn't matter. But if they did differ (would they ever?) then this would be wrong.

Is this an acceptable fix? I'll commit it if so.