Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 8 Oct 2001 23:44:00 -0000 1.2 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 9 Oct 2001 05:04:25 -0000 1.3 @@ -85,26 +85,15 @@ @author arjun@openforce.net @creation-date Sept 2001 } { - # Find out the element_id that corresponds to this - # community_id/portal_id pair - if { [db0or1row get_element_id " - select pem.element_id as element_id - from portal_element_parameters pep, portal_element_map pem - where pem.portal_id = $portal_id and - pep.element_id = pem.element_id and - pep.key = 'community_id' and - pep.value = $community_id"] } { - - # delete the params - # delete the element from the map + # get the element IDs (could be more than one!) + set element_ids [portal::get_element_ids_by_ds $portal_id [my_name]] - } else { - ad_return_complaint 1 "dotlrn_portlet::remove_self_from_page: Invalid portal_id and/or community_id given." - ad_script_abort + # remove all elements + db_transaction { + foreach element_id $element_ids { + portal::remove_element $element_id + } } - - # this call removes the PEs params too - set element_id [portal::remove_element {$portal_id $element_id}] } }