Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-keyword.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-keyword.sql,v
diff -u -r1.18 -r1.19
--- openacs-4/packages/acs-content-repository/sql/postgresql/content-keyword.sql	17 Feb 2004 15:32:50 -0000	1.18
+++ openacs-4/packages/acs-content-repository/sql/postgresql/content-keyword.sql	2 Mar 2004 17:01:47 -0000	1.19
@@ -52,6 +52,10 @@
   where
     keyword_id = set_heading__keyword_id;
 
+  update acs_objects
+  set title = set_heading__heading
+  where object_id = set_heading__keyword_id;
+
   return 0; 
 end;' language 'plpgsql';
 
@@ -94,7 +98,7 @@
 
 select define_function_args('content_keyword__new','heading,description,parent_id,keyword_id,creation_date;now,creation_user,creation_ip,object_type;content_keyword');
 
-create or replace function content_keyword__new (varchar,varchar,integer,integer,timestamptz,integer,varchar,varchar)
+create or replace function content_keyword__new (varchar,varchar,integer,integer,timestamptz,integer,varchar,varchar,integer)
 returns integer as '
 declare
   new__heading                alias for $1;  
@@ -105,15 +109,26 @@
   new__creation_user          alias for $6;  -- default null
   new__creation_ip            alias for $7;  -- default null
   new__object_type            alias for $8;  -- default ''content_keyword''
+  new__package_id             alias for $9;  -- default null
   v_id                        integer;       
+  v_package_id                acs_objects.package_id%TYPE;
 begin
 
+  if new__package_id is null then
+    v_package_id := acs_object__package_id(new__parent_id);
+  else
+    v_package_id := new__package_id;
+  end if;
+
   v_id := acs_object__new (new__keyword_id,
                            new__object_type,
                            new__creation_date, 
                            new__creation_user, 
                            new__creation_ip,
-                           new__parent_id
+                           new__parent_id,
+                           ''t'',
+                           new__heading,
+                           v_package_id
   );
     
   insert into cr_keywords 
@@ -125,7 +140,31 @@
  
 end;' language 'plpgsql';
 
+create or replace function content_keyword__new (varchar,varchar,integer,integer,timestamptz,integer,varchar,varchar)
+returns integer as '
+declare
+  new__heading                alias for $1;  
+  new__description            alias for $2;  -- default null  
+  new__parent_id              alias for $3;  -- default null
+  new__keyword_id             alias for $4;  -- default null
+  new__creation_date          alias for $5;  -- default now()
+  new__creation_user          alias for $6;  -- default null
+  new__creation_ip            alias for $7;  -- default null
+  new__object_type            alias for $8;  -- default ''content_keyword''
+begin
+  return content_keyword__new(new__heading,
+                              new__description,
+                              new__parent_id,
+                              new__keyword_id,
+                              new__creation_date,
+                              new__creation_user,
+                              new__creation_ip,
+                              new__object_type,
+                              null
+  );
 
+end;' language 'plpgsql';
+
 -- procedure delete
 create or replace function content_keyword__delete (integer)
 returns integer as '
