Index: openacs-4/packages/news/sql/postgresql/news-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/sql/postgresql/news-package-create.sql,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/news/sql/postgresql/news-package-create.sql 15 Sep 2005 06:20:26 -0000 1.3.2.1 +++ openacs-4/packages/news/sql/postgresql/news-package-create.sql 15 Sep 2005 14:56:26 -0000 1.3.2.2 @@ -435,8 +435,8 @@ create or replace function news__clone (integer, integer) returns integer as ' declare - p_new_package_id alias for $1; --default null, - p_old_package_id alias for $2; --default null + p_old_package_id alias for $1; --default null, + p_new_package_id alias for $2; --default null one_news record; begin for one_news in select @@ -452,25 +452,31 @@ approval_ip, ao.creation_date, ao.creation_ip, - ao.creation_user + ao.creation_user, + ci.locale, + ci.live_revision, + cr.revision_id from cr_items ci, cr_revisions cr, cr_news cn, acs_objects ao where - (ci.item_id = cr.item_id + cn.package_id = p_old_package_id + and ((ci.item_id = cr.item_id and ci.live_revision = cr.revision_id and cr.revision_id = cn.news_id and cr.revision_id = ao.object_id) or (ci.live_revision is null and ci.item_id = cr.item_id and cr.revision_id = content_item__get_latest_revision(ci.item_id) and cr.revision_id = cn.news_id - and cr.revision_id = ao.object_id) + and cr.revision_id = ao.object_id)) loop perform news__new( + null, + one_news.locale, one_news.publish_date, one_news.text, one_news.nls_language, @@ -481,9 +487,10 @@ one_news.approval_user, one_news.approval_date, one_news.approval_ip, - one_news.creation_date, + null, one_news.creation_ip, - one_news.creation_user + one_news.creation_user, + one_news.live_revision = one_news.revision_id ); end loop;