Forum OpenACS Development: Re: Missing package_ids in acs_objects: get via context_id ?

the context-id is not guaranteed to be a package_id, but for many packages it is. It is also possible that the context_id is a package_id from a different package, but i am not aware of any package, that does this....

However, you should check, if the context_id (or in your code snippet, that i don't understand fully, the variable object_id) is indeed a package_id, otherwise the foreign key constraint acs_objects_package_id_fk will barf on invalid package_ids....

other than this, it should improve the situation. In general, that should be only a migration problem, since well behaved OpenACS 5.* packages should provide the package_ids in acs_objects for every new object.