Index: openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl,v diff -u -r1.9.2.5 -r1.9.2.6 --- openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl 1 Jul 2005 20:25:00 -0000 1.9.2.5 +++ openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl 16 Nov 2005 15:49:32 -0000 1.9.2.6 @@ -166,18 +166,22 @@ @param folder_id folder to update - @param attributes A list of pairs of additional attributes and their values to get. Each pair is a list of two elements: key => value + @param attributes A list of pairs of additional attributes and + their values to set. Each pair is a list of lists of two elements: + key => value + Valid attributes are: label, description, name, package_id @return @error } { - set valid_attributes [list label description package_id] + set valid_attributes [list label description package_id name] set update_text "" - set item_attributes $attributes - set i 0 - foreach {attribute value} $attributes { + + foreach {attribute_list} $attributes { + set attribute [lindex $attribute_list 0] + set value [lindex $attribute_list 1] if {[lsearch $valid_attributes $attribute] > -1} { # create local variable to use for binding @@ -187,10 +191,7 @@ append update_text "," } append update_text " ${attribute} = :${attribute} " - # remove this attribute from the list passed to item::set - set item_attributes [lreplace $item_attributes $i $i] } - incr i } if {![string equal "" $update_text]} { Index: openacs-4/packages/acs-content-repository/tcl/test/content-folder-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/test/content-folder-test-procs.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/acs-content-repository/tcl/test/content-folder-test-procs.tcl 24 Feb 2005 13:32:59 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/test/content-folder-test-procs.tcl 16 Nov 2005 15:49:31 -0000 1.2.2.1 @@ -30,7 +30,19 @@ -folder_id $first_folder_id \ -content_type content_folder + ######################################################### + # Update the folder + ######################################################### + content::folder::update \ + -folder_id $first_folder_id \ + -attributes {{label new_label} {description new_description}} + content::item::get \ + -item_id $first_folder_id \ + -array_name first_folder + aa_true "Folder updated" [expr {($first_folder(label) eq "new_label") && ($first_folder(description) eq "new_description")}] + + ######################################################### # create a child folder ######################################################### set child_folder_id [db_nextval "acs_object_id_seq"]