Index: openacs-4/packages/contacts/sql/postgresql/contacts-messages-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/sql/postgresql/contacts-messages-create.sql,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/contacts/sql/postgresql/contacts-messages-create.sql	29 Jan 2006 16:11:29 -0000	1.8
+++ openacs-4/packages/contacts/sql/postgresql/contacts-messages-create.sql	15 Feb 2006 10:06:36 -0000	1.9
@@ -47,11 +47,13 @@
            cr.title,
            cr.description,
            cr.content,
-           cr.mime_type as content_format
-      from contact_message_items cmi, cr_items ci, cr_revisions cr
+           cr.mime_type as content_format,
+           ao.package_id
+      from contact_message_items cmi, cr_items ci, cr_revisions cr, acs_objects ao
      where cmi.item_id = cr.item_id
        and ci.publish_status not in ( 'expired' )
        and ci.live_revision = cr.revision_id
+       and ci.item_id = ao.object_id
 ;
 
 
