Index: openacs-4/packages/acs-subsite/tcl/relation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/relation-procs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/acs-subsite/tcl/relation-procs.tcl 27 Oct 2014 16:39:46 -0000 1.16 +++ openacs-4/packages/acs-subsite/tcl/relation-procs.tcl 7 Aug 2017 23:47:58 -0000 1.17 @@ -113,9 +113,7 @@ # JCD: this is enforced by trigger so no longer check explicitly # see membership_rels_in_tr # - # set violated_err_msg [db_string select_rel_violation { - # select rel_constraint.violation(:rel_id) from dual - # } -default ""] + # set violated_err_msg [db_string select_rel_violation {} -default ""] # # if { $violated_err_msg ne "" } { # error $violated_err_msg @@ -143,7 +141,7 @@ } { # Pull out the segment_id and the party_id (object_id_two) from # acs_rels. Note the outer joins since the segment may not exist. - if { ![db_0or1row select_rel_info {}] } { + if { ![db_0or1row select_rel_info_rm {}] } { # Relation doesn't exist return 0 } @@ -159,25 +157,25 @@ # acs_rels to find the group and rel_type for this relation. if { $segment_id ne "" } { - if { [relation_segment_has_dependant -segment_id $segment_id -party_id $party_id] } { + if { [relation_segment_has_dependent -segment_id $segment_id -party_id $party_id] } { error "Relational constraints violated by removing this relation" } } - db_exec_plsql relation_delete "begin ${package_name}.del(:rel_id); end;" + db_exec_plsql relation_delete {} return 1 } -ad_proc -public relation_segment_has_dependant { +ad_proc -public relation_segment_has_dependent { { -rel_id "" } { -segment_id "" } { -party_id "" } } { Returns 1 if the specified segment/party combination has a - dependant (meaning a constraint would be violated if we removed this + dependent (meaning a constraint would be violated if we removed this relation). 0 otherwise. Either rel_id or segment_id and party_id must be specified. rel_id takes precedence. @@ -189,13 +187,13 @@ if { $rel_id ne "" } { if { ![db_0or1row select_rel_info {}] } { - # There is either no relation or no segment... thus no dependants + # There is either no relation or no segment... thus no dependents return 0 } } if { $segment_id eq "" || $party_id eq "" } { - error "Both of segment_id and party_id must be specified in call to relation_segment_has_dependant" + error "Both of segment_id and party_id must be specified in call to relation_segment_has_dependent" } return [db_string others_depend_p {}] @@ -368,3 +366,9 @@ return [relation::get_object_two -object_id_one $object_id_one -rel_type $rel_type -multiple] } } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: