Forum OpenACS Development: acs_obejcts dependency

Collapse
Posted by Iuri Sampaio on
I wonder if AMS package has dependecies with acs_objects core table.
I got the sql error bellow when i used api ams::ad_form::save
using a random item_id generated as parameter at:

ams::ad_form::save -package_key "acs-admin" -object_type "content_item" -list_name "item_info" -form_name "insert_item" -object_id $item_id

Database operation "dml" failed
(exception ERROR, "ERROR: insert or update on table "ams_attribute_values" violates foreign key constraint "ams_attribute_values_object_id_fk"
DETAIL: Key (object_id)=(1165) is not present in table "acs_objects".
")

any ideas to turn around on it?
iuri

Collapse
2: Re: acs_obejcts dependency (response to 1)
Posted by Gustaf Neumann on
...using a random item_id generated as parameter at...
do you mean that literally? this is not supposed to work.

acs objects are created with the stored procedure acs_object__new, which creates a fresh object_id and inserts it into acs_objects. This object_id should be used as item_id in your app...