I am creating a node programmatically and I am adding values to other fields without any problem. However I cannot create the node with a value for viewreference field.

I tried many different ways, one of them is:

  $node->field_attached_view[LANGUAGE_NONE][] = array(
    'view_id'   => 'view_name:block',
    'arguments' => NULL,
  );

What is the correct way to add a value for this field on node_save()?

Comments

danielb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)