Forum OpenACS Development: Response to dupicate key error

Collapse
Posted by Ken Kennedy on
The cal_item__new procedure is calling acs_event__new, and passing in the value from your cal_item_id variable as the event_id. The procedure acs_event__new then calls acs_object__new, passing the event_id (which is your cal_item_id), as the object_id. Sounds like '8' (the number you're passing in as your cal_item_id) already exists as an acs_objects.object_id. (I wouldn't be surprised.)

There's probably a sequence being called somewhere to make sure that the id you're creating is unique. I didn't see it in the sql files for calendar, so it may be an existing one called from a procedure somewhere. Look where cal_item__new is being called in the code; just before that, the value for that cal_item_id must be getting set somehow.