Hi, I wish to insert storylinks programmatically and have the following code which seems to fall over (so far) at the $form_id hurdle:
// globals $user;
// $user = user_load(array(uid => 1));
$form_id = 'vote_storylink_node_form';
$node = array('type' => 'vote_storylink');
$form_values = array(
'title' => $linktothread,
'body' => $postcontent,
'URL' => $forumurl . $linktothread,
'name' => $user->name,
);
drupal_execute($form_id, $form_values, $form_values);
}Could you please confim what the $form_id value should be? If you can spot any other potential errors I'd be grateful for the headsup.
Many thanks.
Comments
Comment #1
Cromicon commentedOk I think the form is is storylink.
Currently getting this error though:
First argument is expected to be a valid callback, 'storylink' was given in /xxxxx/public_html/includes/form.inc on line 218.', 2,
Comment #2
marvil07 commentedPlease take a look to the update on the project page, now
5.xis not-really-maintained.If you think your question is still applicably to the last recommended version(
6.x-2.x) please move the version accordingly and reopen it.