Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-folder.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-folder.sql,v
diff -u -r1.43 -r1.44
--- openacs-4/packages/acs-content-repository/sql/postgresql/content-folder.sql	24 Feb 2005 13:32:58 -0000	1.43
+++ openacs-4/packages/acs-content-repository/sql/postgresql/content-folder.sql	18 Mar 2005 03:21:53 -0000	1.44
@@ -428,13 +428,14 @@
 -- 3) update the parent_id for the folder
 
 -- procedure move
-select define_function_args('content_folder__move','folder_id,target_folder_id');
+select define_function_args('content_folder__move','folder_id,target_folder_id,name;NULL');
 
-create or replace function content_folder__move (integer,integer)
+create or replace function content_folder__move (integer,integer,varchar)
 returns integer as '
 declare
   move__folder_id              alias for $1;  
-  move__target_folder_id       alias for $2;  
+  move__target_folder_id       alias for $2;
+  move__name                   alias for $3;
   v_source_folder_id           integer;       
   v_valid_folders_p            integer;
 begin
@@ -476,7 +477,8 @@
 
    -- update the parent_id for the folder
    update cr_items 
-     set parent_id = move__target_folder_id
+     set parent_id = move__target_folder_id,
+         name = coalesce ( move_name, name )
      where item_id = move__folder_id;
 
   -- update the has_child_folders flags
@@ -495,7 +497,21 @@
   return 0; 
 end;' language 'plpgsql';
 
+create or replace function content_folder__move (integer,integer)
+returns integer as '
+declare
+  move__folder_id              alias for $1;  
+  move__target_folder_id       alias for $2;  
+begin
 
+  perform content_folder__move (
+                                move__folder_id,
+                                move__target_folder_id,
+                                NULL
+                               );
+  return null;
+end;' language 'plpgsql';
+
 -- procedure copy
 create or replace function content_folder__copy (integer,integer,integer,varchar)
 returns integer as '
