Index: openacs-4/packages/acs-content-repository/acs-content-repository.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/acs-content-repository.info,v diff -u -r1.43 -r1.44 --- openacs-4/packages/acs-content-repository/acs-content-repository.info 12 Jul 2004 14:49:35 -0000 1.43 +++ openacs-4/packages/acs-content-repository/acs-content-repository.info 20 Jul 2004 15:19:26 -0000 1.44 @@ -7,7 +7,7 @@ t t - + OpenACS The canonical repository for OpenACS content. @@ -20,7 +20,7 @@ other CMS backing functionality. Utilized by Bug Tracker, File Storage, and other packages. - + Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql,v diff -u -r1.56 -r1.57 --- openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql 1 Jul 2004 16:33:38 -0000 1.56 +++ openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql 20 Jul 2004 15:19:27 -0000 1.57 @@ -2285,7 +2285,7 @@ PERFORM content_folder__move(move__item_id, move__target_folder_id,move__name); - else if content_folder__is_folder(move__target_folder_id) = ''t'' then + elsif content_folder__is_folder(move__target_folder_id) = ''t'' then if content_folder__is_registered(move__target_folder_id, Index: openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.2.0d5-5.2.0d6.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.2.0d5-5.2.0d6.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.2.0d5-5.2.0d6.sql 20 Jul 2004 15:19:28 -0000 1.1 @@ -0,0 +1,42 @@ +create or replace function content_item__move (integer,integer,varchar) +returns integer as ' +declare + move__item_id alias for $1; + move__target_folder_id alias for $2; + move__name alias for $3; +begin + + if move__target_folder_id is null then + raise exception ''attempt to move item_id % to null folder_id'', move__item_id; + end if; + + if content_folder__is_folder(move__item_id) = ''t'' then + + PERFORM content_folder__move(move__item_id, move__target_folder_id,move__name); + + elsif content_folder__is_folder(move__target_folder_id) = ''t'' then + + + if content_folder__is_registered(move__target_folder_id, + content_item__get_content_type(move__item_id),''f'') = ''t'' and + content_folder__is_registered(move__target_folder_id, + content_item__get_content_type(content_symlink__resolve(move__item_id)),''f'') = ''t'' + then + -- update the parent_id for the item + + update cr_items + set parent_id = move__target_folder_id, + name = coalesce(move__name, name) + where item_id = move__item_id; + end if; + + if move__name is not null then + update acs_objects + set title = move__name + where object_id = move__item_id; + end if; + + end if; + + return 0; +end;' language 'plpgsql';