Forum OpenACS Q&A: Re: Search package with xowiki

Collapse
Posted by Eduardo Santos on
Just another question, if you don't mind. In the file search/www/search.tcl, in the line 111 there's the following code:
# TODO calculate subsite or dotlrn package_ids
if {![string equal "this" $scope]} {
    # don't send package_id if its not searching this package
    set search_package_id ""
} else {
    set search_node_id [site_node::get_node_id_from_object_id -object_id $search_package_id]
    if {[string equal "dotlrn" [site_node::get_element -node_id $search_node_id -element package_key]]} {
        set search_package_id [site_node::get_children -node_id $search_node_id -element package_id]
    }
}
What's the purpose for this scope var? I couldn't find any definition for it, and I'm losing the the package_id in the search results page. So, if I have to go to page number two in my results, the next page doesn't take the package_id, and the search is performed in the entire site.
Collapse
Posted by Gustaf Neumann on
i thought, you are using openacs 5.2? the code above is from 5.3....

the code in the search package is not from me. Apparently it is broken. When a package_id is passed in, it should be passed to next etc. as well.

The code works better, if you comment out 'set search_package_id ""' in the cited code. With this change the package_id is passed correctly in the "next" link, but still not in the link for page 2 etc. is missing.

maybe dave can comment on this.

Collapse
Posted by Eduardo Santos on
I'm using oacs 5-2, but I've installed the search package from the HEAD, because there are a lot of new search procs wich I wanted to use. As it doesn't depend on any other packages, I can use it without any problem.

About the query I told you, I did comment it out. There's no reason for that check to be made anyway, and I don't think some bug is coming from there. About the links for the pages it's an easy fix that needs to be made, and I did it already. Thanks for the help again.

Collapse
Posted by Gustaf Neumann on
good news.

please report the bug + fix for search.tcl via bug-tracker, it might help some pleople and makes sure, changes are nit forgotten.

Collapse
Posted by Eduardo Santos on
Bug reported and patch uploaded in bugtracker:

https://www.openacs.org/bugtracker/openacs/bug?bug%5fnumber=3061