Index: openacs-4/packages/new-portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.tcl,v diff -u -r1.172.2.2.4.4 -r1.172.2.2.4.5 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 16 Jul 2004 05:40:34 -0000 1.172.2.2.4.4 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 22 Jul 2004 05:47:00 -0000 1.172.2.2.4.5 @@ -146,7 +146,7 @@ set page_name_list [list "Page 1"] set layout_name_list [list "#new-portal.simple_2column_layout_name#"] - + ns_log Warning "CREATING A NEW PORTAL" if {![empty_string_p $csv_list]} { set page_name_and_layout_list [split [string trimright $csv_list ";"] ";"] set page_name_list [list] @@ -718,6 +718,17 @@ db_dml revert_page_update {} + # First, hide all elements. + # If there are new content portlets that are not + # in the default template, this will ensure they don't come + # up. + + db_dml hide_all_elements { + update portal_element_map + set state = 'hidden' + where page_id = :target_page_id + } + # revert elements in two steps like "swap" db_foreach revert_get_source_elements {} { # the element might not be on the target page... @@ -1998,8 +2009,7 @@ if {[llength $element_id_list] == 0} { db_transaction { - - # Tell portal to add this element to the page + # Tell portal to add this element to the page set element_id [add_element \ -portal_id $portal_id \ -portlet_name $portlet_name \ Index: openacs-4/packages/new-portal/tcl/portal-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.xql,v diff -u -r1.42 -r1.42.6.1 --- openacs-4/packages/new-portal/tcl/portal-procs.xql 16 Oct 2002 15:39:16 -0000 1.42 +++ openacs-4/packages/new-portal/tcl/portal-procs.xql 22 Jul 2004 05:47:00 -0000 1.42.6.1 @@ -173,21 +173,24 @@ - + + - select region, - sort_key, - state, - pd.datasource_id as datasource_id, - pd.name as name, - pem.pretty_name as pretty_name - from portal_element_map pem, - portal_datasources pd - where pem.page_id = :source_page_id - and pem.datasource_id = pd.datasource_id + update portal_pages + set pretty_name = :pretty_name, + layout_id = :layout_id + where page_id = :target_page_id + + + update portal_element_map + set state = 'hidden' + where page_id = :target_page_id + + + select element_id