Forum OpenACS Development: Error in xowiki search

Collapse
Posted by Dave Bauer on
[30/Mar/2008:15:38:08][19261.10][-sched:27-] Error: search::indexer: error gett\
ing datasource for 1295 ::xowiki::Page: Can't find result of parameter package_\
url
Can't find result of parameter package_url
::1262 ::xo::Package->package_url
invoked from within
"my package_url"
(procedure "pretty_link" line 19)
::1262 ::xowiki::Package->pretty_link
invoked from within
"::[$page package_id] pretty_link -absolute 1 [$page set name]"
(procedure "::xowiki::datasource" line 39)
invoked from within
"::xowiki::datasource $object_id"
(procedure "AcsSc.ftscontentprovider.datasource.xowiki_page" line 1)
invoked from within

This seems to come from the fact that in the scheduled proc thread the package object is not instantiated.

It calls
::xowiki::Package::intantiate_page_from_id
which calls

::xowiki::Package initialize \
-package_id $package_id -user_id $user_id \
-parameter $parameter -init_url false -actual_query ""
::$package_id set_url -url [::$package_id pretty_link [$page name]]

and attempts to set the package_url using the pretty_link method.

But the pretty link method depends on package_url already being set!

Am I missing someting here? It seems like the accidentally works find if the package has already been creaated but will fail if it has not.

Collapse
2: Re: Error in xowiki search (response to 1)
Posted by Dave Bauer on
It looks like the xowikI::Package init method is not called.
If ound after modifying the code like this

::xowiki::Package initialize \
-package_id $package_id -user_id $user_id \
-parameter $parameter -init_url false -actual_query ""
array set site_node [site_node::get_from_object_id -object_id $package_id]
::$package_id set_url -url $site_node(url)

that the folder_id attribute for the xowiki::Package was not set
so I added it like this:

::xowiki::Package initialize \
-package_id $package_id -user_id $user_id \
-parameter $parameter -init_url false -actual_query ""
array set site_node [site_node::get_from_object_id -object_id $package_id]
::$package_id require_folder_object
::$package_id set_url -url $site_node(url)

and now it works.