I want to do something very simple - create a content of a specific type when a user joins a group.
Unfortunately I can not find a simple way of how it should be done.
It can be done with rules so I've been thinking about triggering one, but the details would be awfully complicated.
I thought about having a template node that I would clone and edit, but how should I go for it? There are number of modules that do that in a strange way, while saying "it might sometimes not work properly", some people use things like
drupal_execute(), I have found that
node_save() has an option
$node->is_new = TRUE.
I found someone suggesting a use of forms, but they were always very simple and were not working with complicated/custom fields. I figured that maybe something like this could work:
$form = drupal_get_form('my_content_node_form'); $form_state = array(); do_some_edits($form,$form_state); drupal_form_submit($form->id, $form_state);
What is a proper/simple way of dealing with this issue? What I would expect see is something like
$node = node_create($content_type) but for some reason I can not find it.