Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.483 -r1.484 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 30 Jun 2015 09:26:13 -0000 1.483 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 23 Jul 2015 03:20:10 -0000 1.484 @@ -1425,7 +1425,18 @@ return $object } + # + # Define a specialized version of CrItem.set_live_revision updating the item index. + # + FormPage ad_instproc set_live_revision {-revision_id:required {-publish_status "ready"}} { + @param revision_id + @param publish_status one of 'live', 'ready' or 'production' + } { + next + my update_item_index + } + # # helper for nls and lang # Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.325 -r1.326 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 15 Jun 2015 19:21:07 -0000 1.325 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 23 Jul 2015 03:20:10 -0000 1.326 @@ -345,7 +345,7 @@ my instvar package_id name $package_id delete -name $name -item_id $item_id } else { - ::xo::db::sql::content_item set_live_revision -revision_id $latest_revision + my set_live_revision -revision_id $latest_revision } } if {$latest_revision ne ""} { @@ -1031,11 +1031,15 @@ # Page instproc make-live-revision {} { - my instvar revision_id item_id package_id - #my log "--M set_live_revision($revision_id)" - ::xo::db::sql::content_item set_live_revision -revision_id $revision_id - set page_id [my query_parameter "page_id"] - ::xo::clusterwide ns_cache flush xotcl_object_cache ::$item_id + my instvar package_id + set page_id [my query_parameter "revision_id"] + if {[string is integer -strict $page_id]} { + set revision_id $page_id + } else { + set revision_id [my set revision_id] + } + #my log "--M set_live_revision $revision_id" + my set_live_revision -revision_id $revision_id ::$package_id returnredirect [my query_parameter "return_url" \ [export_vars -base [$package_id url] {{m revisions}}]] } Index: openacs-4/packages/xowiki/www/admin/set-publish-state.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/set-publish-state.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/xowiki/www/admin/set-publish-state.tcl 27 Oct 2014 16:42:07 -0000 1.10 +++ openacs-4/packages/xowiki/www/admin/set-publish-state.tcl 23 Jul 2015 03:20:11 -0000 1.11 @@ -9,20 +9,21 @@ @param query } -parameter { {-state:required} - {-revision_id:required} + {-revision_id:integer,required} {-return_url "."} } set item_id [xo::dc get_value get_item_id \ {select item_id from cr_revisions where revision_id = :revision_id}] -ns_cache flush xotcl_object_cache ::$item_id +set page [::xo::db::CrClass get_instance_from_db -item_id $item_id -revision_id $revision_id] +$page set_live_revision \ + -revision_id $revision_id \ + -publish_status $state + +#ns_cache flush xotcl_object_cache ::$item_id ns_cache flush xotcl_object_cache ::$revision_id -::xo::db::sql::content_item set_live_revision \ - -revision_id $revision_id \ - -publish_status $state - if {$state ne "production"} { ::xowiki::notification::do_notifications -revision_id $revision_id ::xowiki::datasource $revision_id