Index: openacs-4/packages/acs-content-repository/sql/oracle/content-type.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/content-type.sql,v diff -u -r1.2.4.1 -r1.2.4.2 --- openacs-4/packages/acs-content-repository/sql/oracle/content-type.sql 27 Feb 2003 13:45:29 -0000 1.2.4.1 +++ openacs-4/packages/acs-content-repository/sql/oracle/content-type.sql 5 Mar 2003 16:53:03 -0000 1.2.4.2 @@ -56,9 +56,22 @@ table_exists integer; v_supertype_table acs_object_types.table_name%TYPE; - + v_count integer; begin + if (supertype != 'content_revision') and (content_type != 'content_revision') then + select count(*) + into v_count + from acs_object_type_supertype_map + where object_type = create_type.supertype + and ancestor_type = 'content_revision'; + + if v_count = 0 then + raise_application_error(-20000, 'Content types can only be created as subclasses of content_revision or a derivation thereof. ' || supertype || ' is not a subclass oc content_revision.'); + end if; + end if; + + -- create the attribute table if not already created select decode(count(*),0,0,1) into table_exists from user_tables