I have run into some problems while exploring the CR, in particular with respect to context_id.
There are two custom content types, cu_sequence and cu_activity, which I want to use in the following way:
There will be a tree of "activities" where the root activity has a "sequence" item as its parent. The problem is that, when I add a child activity item, regardless of which of the two types the parent is, the context_id of the child item gets set to the same value as its own item_id - even when I provide content_item__new with $sequence_id as p_context_id (I use the version of content_item__new that takes 16 params).
Is this the intended/correct way of things? It makes it a little difficult to scope the activities in the tree to the parent sequence. That sequence_id was what I was hoping to use as the context for all the children in that particular activity tree, since there can be several trees (with different parent sequences) living in parallel - all of which should be able to be displayed separately.
I hope that the snippet below shows what I mean.
I guess the real question is; what is the preferred way of setting the context_id explicitly, and, is this a bug?
Perhaps it would be better of me to use a separate extended attribute, "sequence_id", to the attributes table for my content type, i.e., the cu_activities table?
BTW, when using CR, what would seem the most standardized way to name url vars; ?item_id=1234 vs. ?sequence_id=1234, etc...?
select name, object_type, context_id, item_id, parent_id
from cr_revisionsx
where item_id in (2853, 2855, 2864);
name | object_type | context_id | item_id | parent_id
----------------+-------------+------------+---------+-----------
TEST SEQUENCE | cu_sequence | 2853 | 2853 | -100
ROOT ACTIVITY | cu_activity | 2855 | 2855 | 2853
CHILD ACTIVITY | cu_activity | 2864 | 2864 | 2855
(3 rows)