Forum OpenACS Development: rel_types::new on HEAD is broken

Collapse
Posted by Randy O'Meara on
packages/acs-subsite/tcl/package-procs.tcl
@cvs-id $Id: package-procs.tcl,v 1.19 2004/06/06 02:28:40 donb Exp $
There are substantial differences between HEAD and 5.1 versions of packages/acs-subsite/tcl/package-procs.tcl, at least one of which (I believe) is responsible for the following error:
WARNING:  Error occurred while executing PL/pgSQL function define_function_args

Error: Ns_PgExec: result status: 7 message: ERROR:  Cannot insert a duplicate key into unique index acs_function_args_un
With debug enabled, the define_function_args call looks like:
 define_function_args('observer_rel__new','rel_id,object_type,creation_date,creation_ip,last_modified,modifying_ip,creation_user,context_id,package_id,title,OBJECT_ID_TWO,OBJECT_ID_ONE,CREATION_USER,MEMBER_STATE,REL_TYPE;observer_rel,CREATION_IP');
The cause of this error is that creation_ip appears twice.

The error occurs on the following call which does return without error on 5.1 (var values translated by me to give meaning to this example):

set m_rel_type [rel_types::new \
                   -supertype "membership_rel" \
                   -role_one "" \
                   -role_two "observer" \
                   "observer_rel" \
                   "Observer" \
                   "Observers" \
                   "group" "0" "" \
                   "person" "0" "1"]
/R
Collapse
Posted by Jeff Davis on
I committed a fix for this on head. It was caused by the same issue that caused bug 1893. In the future I suggest you submit a bug for things like this since it's too easy to overlook it if it's in the forums.
Collapse
Posted by Randy O'Meara on
Thank you. Will do.