Forum OpenACS Development: Response to input view on postgres

Collapse
Posted by Dan Wickstrom on
I tried the following:

openacs4=# select version();
-[ RECORD 1 ]-------------------------------------------------------------
version | PostgreSQL 7.2.1 on sparc-sun-solaris2.8, compiled by GCC 2.95.3
openacs4=# select content_folder__register_content_type(-100,'cr_foo','f');
-[ RECORD 1 ]-------------------+--
content_folder__register_conten | 0

openacs4=#         select content_item__new (
                'foo_item2',
                NULL,
                NULL,
                NULL,
                current_timestamp,
                null,
                null,
                null,
                'content_item',
                'cr_foo',
                NULL,
                NULL,
                NULL,
                NULL,
                NULL
        );
-[ RECORD 1 ]-
content_item__new | 2585

openacs4=# select acs_object_id_seq.nextval from dual;
N-[ RECORD 1 ]-
nextval | 2586

openacs4=# insert into cr_fooi (item_id, 
                     revision_id, 
                     title, 
                     description, 
                     context_id, 
                     creation_user, 
                     creation_ip) 
values (2585,2586,'foo test','this is a test of foo',null,null,null);
INSERT 0 0
openacs4=# select * from cr_foo; 
-[ RECORD 1 ]
foo_id | 2586

The key was that I needed to register the content type to the root folder.