Forum OpenACS Q&A: Two fixes for News search problem ...

News package is from OpenACS 4.6.1 final tar.

news/tcl/news-procs.xql
------------------
In following select query package_id is misspelled as package_i.

#KRN package_id was misspelled as package_i (problem in search)
<fullquery name="news__url.get_package_id">
        <querytext>
        select package_id
        from cr_news
        where news_id=:object_id
        </querytext>
</fullquery>

news/tcl/news-procs.tcl
------------------
In following func 'set url_stub [news_util_get_url news]' should be
'set url_stub [news_util_get_url $package_id]'

ad_proc news__url {
    object_id
} {
    @author Robert Locke
} {

    set package_id [db_string get_package_id {*SQL*}]

#KRN news_util_get_url takes package_id as paramter. Here it was news!
    set url_stub [news_util_get_url $package_id]

    db_1row get_item_id "
        select item_id
        from cr_revisions
        where revision_id=:object_id
    "

    set url "${url_stub}item?item_id=$item_id"

    return $url
}

I don't have the set up to check in the stuff, so could somebody please take care of fixing these. With above fixes search in News items worked for me, so I assume these are right fixes.

-Kiran

Collapse
Posted by Robert Locke on
Thanks Kiran!  I installed your fixes to the HEAD as well as the oacs-4-6 branch a few days ago.

I just forgot to send out email despite Don's friendly reminders to do so. =)

Collapse
Posted by Kiran Halwai on
You are very welcome! -Kiran