These are chat archives for collectiveaccess/support

10th
Nov 2016
Karl Becker
@karbecker
Nov 10 2016 09:39
Hi! I’ve got one more comprehension question using <if> rules for display templates. I want a unit to show only if the according list element is set to yes. Is this the correct way to tackle it? Doesnt work for me right now, perhaps I am missing something:
{{{<unit relativeTo="ca_objects" delimiter="<br/"><if rule=\"^ca_objects.containername.listelement =~ /listelement_yes/\">^ca_objects.containername.listelement</if></unit>}}}
naeemmuhammad
@naeemmuhammad
Nov 10 2016 14:41

Hi, I am trying to create an object with a relationship to 'ca_collections' by using rest api 'put' call. But i get the error 'Cannot add or update a child row: a foreign key constraint fails (test_ca_crkc.ca_objects_x_collections, CONSTRAINT fk_ca_objects_x_collections_collection_id FOREIGN KEY (collection_id) REFERENCES ca_collections (collection_id)) [250]'

If i remove the relationship information from the request body, i am able to create object. Any help to solve this problem will be appreciated.

Request body of the call is:
Array
(
[intrinsic_fields] => Array
(
[idno] => CRKC.0038.000237
[type_id] => 21
)
[related] => Array
(
[ca_collections] => Array
(
[collection_id] => 38
[item_type_id] => 102
)
)
)