Forum OpenACS Development: error on file-selector xinha plugin in oracle

I found that in the file-selector plugin in the xinha editor, when trying to select an image from the FS, if the image is in the root folder, it adds the wrong path.

The path for the folders in the FS are get using "::xo::db::sql::content_item get_path", I understand that the fs_folders have a key, but the key of the root folder is "file-storage_####" I supposed it was gonna be empty, so the image from the root folder comes with a path /file-storage/view/../file-storage_####/$file_name and it should be /file-storage/view/$file_name.

any ideas, thanks in advance

--
Alvaro

Collapse
Posted by Gustaf Neumann on
Hmm, looks like a bug in the content_item.get_path implementation in Oracle. For the root folder, the folder_path is "" (empty). In this case, item_id == root_folder_id.

Maybe content_item.get_path is only broken, when the item_id is the root_folder_id. If yes, then a possible fix is to use the following snippet in file-selector.tcl

set folder_path ""
if {$root_folder_id != $folder_id} {
   set folder_path [::xo::db::sql::content_item get_path \
                     -item_id $folder_id \
                     -root_folder_id $root_folder_id]
}
Please let me know, what you find out. Best regards -gustaf neumann
Collapse
Posted by Alvaro Rodriguez on
That's exactly what I did for now. I was checking at the content_item.get_path function but I don't have enough time to debug right now.

I will dig into it later on.

Regards,

--
Alvaro