Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-create.sql,v diff -u -N -r1.59 -r1.60 --- openacs-4/packages/acs-content-repository/sql/postgresql/content-create.sql 4 Aug 2011 08:26:20 -0000 1.59 +++ openacs-4/packages/acs-content-repository/sql/postgresql/content-create.sql 6 Aug 2012 18:06:13 -0000 1.60 @@ -701,7 +701,8 @@ from cr_items i, cr_revisions r where i.item_id = r.item_id and r.revision_id = old.revision_id - and i.storage_type = 'file'; + and i.storage_type = 'file' + and r.content is not null; return old; END; Index: openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.8.0d1-5.8.0d2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.8.0d1-5.8.0d2.sql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.8.0d1-5.8.0d2.sql 11 Jul 2011 09:38:09 -0000 1.1 +++ openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.8.0d1-5.8.0d2.sql 6 Aug 2012 18:06:14 -0000 1.2 @@ -644,7 +644,8 @@ from cr_items i, cr_revisions r where i.item_id = r.item_id and r.revision_id = old.revision_id - and i.storage_type = 'file'; + and i.storage_type = 'file' + and r.content is not null; return old; END;