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.14 -r1.14.8.1 --- openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl 5 Mar 2008 20:16:38 -0000 1.14 +++ openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl 30 Sep 2013 17:44:27 -0000 1.14.8.1 @@ -60,7 +60,7 @@ foreach var [list folder_id name label description parent_id context_id package_id] { lappend var_list [list $var [set $var]] } - if {[exists_and_not_null creation_date]} { + if {[info exists creation_date] && $creation_date ne ""} { lappend var_list [list creation_date $creation_date] } set folder_id [package_instantiate_object \ Index: openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl,v diff -u -r1.22 -r1.22.4.1 --- openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl 9 Jun 2010 16:51:27 -0000 1.22 +++ openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl 30 Sep 2013 17:44:27 -0000 1.22.4.1 @@ -126,11 +126,12 @@ # since we can't rely on content_item__new to create a revision # we have to pass is_live to content::revision::new and # set the live revision there - if {[exists_and_not_null title] \ - || [exists_and_not_null text] \ - || [exists_and_not_null data] \ - || [exists_and_not_null tmp_filename] \ - || [llength $attributes]} { + if {([info exists title] && $title ne "") + || ([info exists text] && $text ne "") + || ([info exists data] && $data ne "") + || ([info exists tmp_filename] && $tmp_filename ne "") + || [llength $attributes] + } { content::revision::new \ -item_id $item_id \ -title $title \ @@ -202,7 +203,7 @@ set var_list [list \ [list item_id $item_id] \ [list target_folder_id $target_folder_id] ] - if {[exists_and_not_null name]} { + if {[info exists name] && $name ne ""} { lappend var_list [list name $name] } return [package_exec_plsql \ @@ -818,7 +819,8 @@ set mime_type [template::util::file::get_property mime_type $upload_file] set tmp_size [file size $tmp_filename] set extension [file extension $filename] - if {![exists_and_not_null title]} { + # GN: where is the title supposed to come from? missing nonpos arg? + if {![info exists title] || $title eq ""} { # maltes: The following regsub garbles the title and consequently the filename as well. # "info_c+w.zip" will become "info_c+" Index: openacs-4/packages/acs-content-repository/tcl/content-keyword-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-keyword-procs.tcl,v diff -u -r1.4 -r1.4.16.1 --- openacs-4/packages/acs-content-repository/tcl/content-keyword-procs.tcl 21 Jan 2005 14:25:07 -0000 1.4 +++ openacs-4/packages/acs-content-repository/tcl/content-keyword-procs.tcl 30 Sep 2013 17:44:27 -0000 1.4.16.1 @@ -181,10 +181,10 @@ [list creation_user $creation_user ] \ [list creation_ip $creation_ip ] \ ] - if {[exists_and_not_null creation_date]} { + if {[info exists creation_date] && $creation_date ne ""} { lappend var_list [list creation_date $creation_date ] } - if {[exists_and_not_null object_type]} { + if {[info exists object_type] && $object_type ne ""} { lappend var_list [list object_type $object_type ] } return [package_exec_plsql -var_list $var_list content_keyword new] Index: openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl,v diff -u -r1.25.6.1 -r1.25.6.2 --- openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl 29 Sep 2013 11:50:55 -0000 1.25.6.1 +++ openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl 30 Sep 2013 17:44:27 -0000 1.25.6.2 @@ -92,10 +92,10 @@ set creation_ip [ad_conn peeraddr] } - if {![exists_and_not_null content_type]} { + if {![info exists content_type] || $content_type eq ""} { set content_type [::content::item::content_type -item_id $item_id] } - if {![exists_and_not_null storage_type]} { + if {$storage_type eq ""} { set storage_type [db_string get_storage_type ""] } if {![info exists package_id]} { @@ -104,16 +104,17 @@ set attribute_names "" set attribute_values "" - if { [exists_and_not_null attributes] } { + if { [info exists attributes] && $attributes ne "" } { set type_attributes [package_object_attribute_list $content_type] set valid_attributes [list] # add in extended attributes for this type, ingore # content_revision as those are already captured as named # parameters to this procedure foreach type_attribute $type_attributes { - if {"cr_revisions" ne [lindex $type_attribute 1] \ - && "acs_objects" ne [lindex $type_attribute 1] } { + if {"cr_revisions" ne [lindex $type_attribute 1] + && "acs_objects" ne [lindex $type_attribute 1] + } { lappend valid_attributes [lindex $type_attribute 2] } } Index: openacs-4/packages/acs-content-repository/tcl/content-symlink-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-symlink-procs.tcl,v diff -u -r1.5 -r1.5.12.1 --- openacs-4/packages/acs-content-repository/tcl/content-symlink-procs.tcl 4 Jun 2006 00:45:23 -0000 1.5 +++ openacs-4/packages/acs-content-repository/tcl/content-symlink-procs.tcl 30 Sep 2013 17:44:27 -0000 1.5.12.1 @@ -87,7 +87,7 @@ [list creation_user $creation_user ] \ [list creation_ip $creation_ip ] \ ] - if {[exists_and_not_null creation_date]} { + if {[info exists creation_date] && $creation_date ne ""} { lappend var_list [list creation_date $creation_date ] } return [package_exec_plsql -var_list $var_list content_symlink new] Index: openacs-4/packages/acs-content-repository/tcl/content-template-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-template-procs.tcl,v diff -u -r1.7 -r1.7.16.1 --- openacs-4/packages/acs-content-repository/tcl/content-template-procs.tcl 6 Jan 2005 16:52:25 -0000 1.7 +++ openacs-4/packages/acs-content-repository/tcl/content-template-procs.tcl 30 Sep 2013 17:44:27 -0000 1.7.16.1 @@ -44,7 +44,7 @@ [list creation_ip $creation_ip ] \ [list package_id $package_id ] \ ] - if {[exists_and_not_null creation_date]} { + if {([info exists creation_date] && $creation_date ne "")} { lappend arg_list [list creation_date $creation_date ] } return [package_exec_plsql -var_list $arg_list content_template new] Index: openacs-4/packages/acs-content-repository/tcl/item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/item-procs.tcl,v diff -u -r1.28 -r1.28.4.1 --- openacs-4/packages/acs-content-repository/tcl/item-procs.tcl 26 May 2010 16:03:28 -0000 1.28 +++ openacs-4/packages/acs-content-repository/tcl/item-procs.tcl 30 Sep 2013 17:44:27 -0000 1.28.4.1 @@ -116,8 +116,10 @@ # Get the mime type, decide if we want the text get_mime_info $revision_id - if { [exists_and_not_null mime_info(mime_type)] && \ - [string equal [lindex [split $mime_info(mime_type) "/"] 0] "text"] } { + if { [info exists mime_info(mime_type)] + && $mime_info(mime_type) ne "" + && [string match "text/*" $mime_info(mime_type)] + } { set text_sql [db_map grc_get_all_content_1] } else { set text_sql "" @@ -483,7 +485,7 @@ # Strip off file extension set last [string last "." $url] if { $last > 0 } { - set url [string range $url 0 [expr {$last - 1}]] + set url [string range $url 0 $last-1] } if {$root_folder ne ""} { Index: openacs-4/packages/acs-content-repository/tcl/publish-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/publish-procs.tcl,v diff -u -r1.10 -r1.10.2.1 --- openacs-4/packages/acs-content-repository/tcl/publish-procs.tcl 12 Apr 2013 16:12:56 -0000 1.10 +++ openacs-4/packages/acs-content-repository/tcl/publish-procs.tcl 30 Sep 2013 17:44:27 -0000 1.10.2.1 @@ -78,7 +78,7 @@ } { set index [string last "/" $path] if { $index != -1 } { - file mkdir [string range $path 0 [expr {$index - 1}]] + file mkdir [string range $path 0 $index-1] } } @@ -815,7 +815,7 @@ set subitems [db_list cs_get_subitems_related ""] } - set sub_item_id [lindex $subitems [expr {$index - 1}]] + set sub_item_id [lindex $subitems $index-1] if { [template::util::is_nil sub_item_id] } { ns_log notice "publish::render_subitem: No such subitem" Index: openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl,v diff -u -r1.30.4.2 -r1.30.4.3 --- openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl 28 Sep 2013 14:49:10 -0000 1.30.4.2 +++ openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl 30 Sep 2013 17:44:27 -0000 1.30.4.3 @@ -92,7 +92,7 @@ ns_set put [ns_conn outputheaders] "Content-Length" 0 ns_return 200 text/plain {} } else { - if {[info command ad_returnfile_background] eq "" || [security::secure_conn_p]} { + if {[info commands ad_returnfile_background] eq "" || [security::secure_conn_p]} { ns_returnfile 200 $mime_type $filename } else { ad_returnfile_background 200 $mime_type $filename @@ -243,9 +243,10 @@ # the AOLserver jpegsize command has some bugs where the height comes # through as 1 or 2 - if { $what_aolserver_told_us ne "" && \ - [lindex $what_aolserver_told_us 0] > 10 && \ - [lindex $what_aolserver_told_us 1] > 10 } { + if { $what_aolserver_told_us ne "" + && [lindex $what_aolserver_told_us 0] > 10 + && [lindex $what_aolserver_told_us 1] > 10 + } { set original_width [lindex $what_aolserver_told_us 0] set original_height [lindex $what_aolserver_told_us 1] } else { Index: openacs-4/packages/acs-content-repository/tcl/test/acs-content-repository-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/test/acs-content-repository-procs.tcl,v diff -u -r1.3 -r1.3.16.1 --- openacs-4/packages/acs-content-repository/tcl/test/acs-content-repository-procs.tcl 1 Mar 2005 00:01:22 -0000 1.3 +++ openacs-4/packages/acs-content-repository/tcl/test/acs-content-repository-procs.tcl 30 Sep 2013 17:44:27 -0000 1.3.16.1 @@ -22,9 +22,10 @@ # retrieve the parent's child set new_keyword_id [cr::keyword::new -heading $name] - aa_true "created a new cr_keyword" [exists_and_not_null new_keyword_id] + aa_true "created a new cr_keyword" [expr {[info exists new_keyword_id] && $new_keyword_id ne ""}] + set new_keyword_id_2 [cr::keyword::new -heading $name_2 -parent_id $new_keyword_id] - aa_true "created a child cr_keyword" [exists_and_not_null new_keyword_id_2] + aa_true "created a child cr_keyword" [expr {[info exists new_keyword_id_2] && $new_keyword_id_2 ne ""}] set children [cr::keyword::get_children -parent_id $new_keyword_id ] aa_true "child is returned" [string match "*$new_keyword_id_2*" $children]