Forum OpenACS Development: Re: Calendar pkg: call_item and acs_activity

Collapse
Posted by Iuri Sampaio on
Peharps, it is time to add xotcl's proc into caledar's pkg.
Collapse
Posted by Antonio Pisano on
Dear Iuri,

the technical reason why activities don't get removed automatically at the removal of a cal_item is this: cal_items.cal_item_id references acs_events.event_id, but no ON DELETE behavior is defined. On the other hand, acs_events.event_id references acs_activities.activity_id and there we have ON DELETE SET NULL defined. Therefore, is not clear to me whether automatic deletion of related activity and event tuples is fine in general for all packages that reuse acs-events.

I will try to have a deeper look, in the meantime whoever might have better insight could give some comments.

Ciao

Antonio

Collapse
Posted by Antonio Pisano on
Mmm...

actually, if one looks at calendar::item::delete -cal_item_id https://openacs.org/api-doc/proc-view?proc=calendar::item::delete&source_p=1, this should call ca_item__delete stored procedure https://openacs.org/api-doc/plsql-subprogram-one?name=cal_item__delete&type=FUNCTION, which should in fact remove the acs_event.

Are you making use of this API? Or you're deleting via some custom code?

Ciao

Collapse
Posted by Iuri Sampaio on
Indeed Antonio,
I've used cal_item__delete and I haven't touched into the core's ad_procs.

Pkg versions are:
provides url="calendar" version="2.6.1d3"/
provides url="acs-events" version="0.6.1.1"
provides url="acs-kernel" version="5.9.1"/

I've noticed the dependencies (relationships) among calendar, acs-events and so, while I was debugging the "code workflow".

Thanks for the lesson! I understand why acs-events supports calendar pkg. It makes total sense.

Best wishes,