Forum OpenACS Development: Re: Error in Xowiki Upgrade

Collapse
Posted by Eduardo Santos on
Hi Gustaf,

I guess I've found the error, but I don't know how to solve it. The method that gets the folder_id is probably wrong.

In the file xowiki/tcl/includelet-procs.tcl, in line 2209, inside the render_button method, there are the following lines:

    set p_link [$package_id pretty_link -parent_id [$page parent_id] [$page name]]
    set link [$package_id make_link -link $p_link $page $method \
              return_url page_order source_item_id]

Just before this code I've inserted a log call to find the parent_id for this button object, wich looks like this:

      my log "111111111111111111111111111: [$page parent_id] | [$page item_id] | [$page name]"
    set p_link [$package_id pretty_link -parent_id [$page parent_id] [$page name]]
    set link [$package_id make_link -link $p_link $page $method \
              return_url page_order source_item_id]

My log call returned as parent_id the root folder (-100).

 111111111111111111111111111: -100 | 5898991 | pt:teste_artigos_news, ::xotcl::__#g
::xowiki::includelet::item-button->render_button (810ms, 32ms)

So, I've performed the following query in DB:

select item_id, page_id, parent_id from xowiki_form_pagex where item_id = 5898991;

 item_id | page_id | parent_id
---------+---------+-----------
 5898991 | 5898993 |   5651468
 5898991 | 5898990 |   5651468

The parent_id in the select is different from the one returned by the method. it seems like there's a problem in the cr objects attributes fetch, but I guess this is beyond my knowledgements in XoTcl. Can you tell me why this is happening?