Forum OpenACS Q&A: Re: Project manager 1.05 released

Collapse
Posted by Richard Hamilton on
Jade,

Sorry - that post was not very clear. I had read your instructions and posted the location of the proc after I found it to help others. However although following your instructions eliminated the error on initial browsing after mounting the package, as soon as I either create a new project in the logger or link a project that already exists in the project manager, I get the error again.

Just to double check, is this the correct proc to be putting into /lib/entries.tcl

ad_proc -public get_mapped_trees_from_object_list { object_id_list } {
    Get the category trees mapped to a list of objects.

    @param object_id_list list of object to get the mapped category trees.
    @return tcl list of lists: tree_id tree_name subtree_category_id
                assign_single_p require_category_p
    @author Jade Rubick (mailto:jader@bread.com)
} {
    set result [list]

    db_foreach get_mapped_trees_from_object_list "" {
        lappend result [list $tree_id [get_name $tree_id] $subtree_category_id $assign_single_p $require_category_p]
    }

    return $result
}

Regards
Richard

Collapse
Posted by Jade Rubick on
Hi Richard,

You need to put the following at the end of this file:

/packages/categories/tcl/category-trees-procs.tcl

----------------------

ad_proc -public get_mapped_trees_from_object_list { object_id_list } {
    Get the category trees mapped to a list of objects.

    @param object_id_list list of object to get the mapped category trees.
    @return tcl list of lists: tree_id tree_name subtree_category_id
                assign_single_p require_category_p
    @author Jade Rubick (mailto:jader@bread.com)
} {
    set result [list]

    db_foreach get_mapped_trees_from_object_list "" {
        lappend result [list $tree_id [get_name $tree_id] $subtree_category_id $assign_single_p $require_category_p]
    }

    return $result
}

---------------------------

and in /packages/categories/tcl/category-trees-procs.xql, below this section:

<fullquery name="category_tree::get_mapped_trees.get_mapped_trees">
      <querytext>

            select tree_id, subtree_category_id, assign_single_p,
                  require_category_p
            from category_tree_map
            where object_id = :object_id

      </querytext>
</fullquery>

----------------------
add this:
----------------------

<fullquery name="category_tree::get_mapped_trees_from_object_list.get_mapped_trees_from_object_list">
      <querytext>

            select tree_id, subtree_category_id, assign_single_p,
                  require_category_p
            from category_tree_map
            where object_id in ([join $object_id_list ", "])

      </querytext>
</fullquery>

---------------------

Hope that helps, and thank you for posting bug reports, and for providing all this feedback. Unfortunately, project-manager is a very complex piece of software, and I try to have it work perfectly, but it just doesn't cooperate!