Index: openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl,v diff -u -r1.53 -r1.54 --- openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 11 Sep 2024 06:15:56 -0000 1.53 +++ openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 25 Nov 2024 16:22:08 -0000 1.54 @@ -13,26 +13,45 @@ returns a datasource for the search package } { - #ns_log notice "--sc ::xowiki::datasource called with revision_id = $revision_id" - set page [::xowiki::Package instantiate_page_from_id -revision_id $revision_id -user_id 0] + set d [list \ + object_id $revision_id \ + title "" \ + content "" \ + text "" \ + html "" \ + keywords "" \ + storage_type text \ + mime text/html \ + ] + try { + #ns_log notice "--sc ::xowiki::datasource called with revision_id = $revision_id" + set page [::xowiki::Package instantiate_page_from_id -revision_id $revision_id -user_id 0] + } on error {errmsg} { + ns_log warning ::xowiki::datasource \ + {Could not instantiate page} $revision_id $errmsg + return $d + } + #ns_log notice "--sc ::xowiki::datasource $page [$page set publish_status]" if {[$page set publish_status] in {production expired}} { # # No data source result for pages under construction # #ns_log notice "--sc page under construction, no datasource" - return [list object_id $revision_id title "" \ - content "" keywords "" \ - storage_type text mime text/html] + return $d } #ns_log notice "--sc setting absolute links for page = $page [$page set name]" - set d [dict merge \ - {mime text/html text "" html "" keywords ""} \ - [$page search_render]] + try { + set d [dict merge $d [$page search_render]] + } on error {errmsg} { + ns_log warning ::xowiki::datasource \ + {Could not render page} $revision_id $errmsg + return $d + } if {![dict exists $d title]} { dict set d title [$page title]