Forum OpenACS Development: Re: file-storage items on table cr_items

Collapse
Posted by Hamilton Chua on
Iuri,

Thanks for elaborating. I agree with Dave, it's not necessarily an AjaxFS issue, it might be an issue with fs::rename.

I looked at one installation with File Storage and the sql for fs::rename_folder looks like this

***************

select content_folder__edit_name(
:folder_id,
null,
:name,
null

****************

the plsql proc for content_folder__edit_name looks like

****************
declare
edit_name__folder_id alias for $1;
edit_name__name alias for $2; -- default null
edit_name__label alias for $3; -- default null
edit_name__description alias for $4; -- default null
v_name_already_exists_p integer;
begin

if edit_name__name is not null and edit_name__name != '' then
PERFORM content_item__edit_name(edit_name__folder_id, edit_name__name);
end if;

if edit_name__label is not null and edit_name__label != '' then
update acs_objects
set title = edit_name__label
where object_id = edit_name__folder_id;
end if;

if edit_name__label is not null and edit_name__label != '' and
edit_name__description is not null and edit_name__description != '' then

update cr_folders
set label = edit_name__label,
description = edit_name__description
where folder_id = edit_name__folder_id;

else if(edit_name__label is not null and edit_name__label != '') and
(edit_name__description is null or edit_name__description = '') then
update cr_folders
set label = edit_name__label
where folder_id = edit_name__folder_id;

end if; end if;

return 0;
end;
****************

The plsql proc has code to rename the cr.item name BUT since that parameter is getting "null" it's not doing the rename. Only cr_folder.label and acs_objects.title are changed.