Forum OpenACS Development: Re: Error in Xowiki Upgrade

Collapse
Posted by Gustaf Neumann on
Well, this was the version from the oacs5-4 branch; the symptom is that get_instance_from_db is called with a folder_id (acs_type content folder), and for the content folder, there is no XOTcl class defined. The problem is, the news item, for which the edit-button is to be created, seems to have a folder_id as parent_id that is different to the main folder id of this xowiki instance. Can you check this?

Background: The new xowiki versions support xowiki pages having other xowiki pages as parent_ids. This is used currently primarily for embedded content, such as files/images attached to pages (e.g. xowiki::FormPages having attached uploaded files). For this included content, xowiki constructs a unix-like path for the names (using slashes as delimiters). This is implemented via the folder_path method.

I have fixed the symptoms in the oacs-5-4 branch the same way as was already in cvs head. But please, check the parent_ids for this/these items, maybe there is something else wrong....

Collapse
Posted by Eduardo Santos on
Hi Gustaf,

I order to test your hypothesis, I've used the following query:

select x.item_id,
c.name,
c.parent_id,
c2.name,
c3.folder_id,
c3.package_id
from xowiki_form_pagei x
inner join cr_items c on x.item_id = c.item_id
inner join cr_items c2 on c.parent_id = c2.item_id
inner join cr_folders c3 on c.parent_id = c3.folder_id
order by x.item_id desc;

In all the cases I could find, the xowiki_form_page parent_id is the same value as the xowiki root content_folder. The funny thing about it is that I had, a while ago, one problem where some pages where going to other folders different from the xowiki root one. Do you think these issues can be related?

I'll try to find out if there are any other xowiki pages or objects in other folders different from the package root. Maybe this is a good investigation line.

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?