Add onto a form from other sources (like a subform) before submitting
You spend enough time in FAPI and it speaks to you. (UPDATE: but it speaks lies.)
The beginnings of a chance to catch material from the subform and duplicate it for the main form:
this should take care of prefilling places
What hasn't worked:
/* did NOT work */
function wsf_action_combined_action_submit($form_id, &$form_values) {
drupal_set_message('<pre>' . print_r($form_values, TRUE) . '</pre>');
if (isset($form['#node'])) {
$node = $form['#node'];
}
else {
$node = array('type' => 'action');
}
drupal_execute('action_node_form', $form_values, $node);
}
Neither did simply:
drupal_execute($form_id, $form_values);
Or a couple other variations. Hrm, harrumph, and hibbidy.
Related in a weird way, and I need a freetagging vocabulary to be able to replace the page title for the Organization content type.
Term Token Does Not Work Until User Edits a content type
http://drupal.org/node/137669
They say there's no way to do it with token.
So again, I need to get in there, somewhere in the form process, and duplicate information I know I have--- take what's been entered into $form['tag'] or whatever and set $form['title'] equal to that (well, form title's #value).
From http://api.drupal.org/api/function/node_form/5
$form['#after_build'] = array('node_form_add_preview');
Is after_build my savior? Stay tuned...
Comments
NO, #after_build does not
NO, #after_build does not look like it will help.
validate, on the other hand, may be able to be twisted and abused to suit Agaric's evil needs...
WHY drupal_execute doesn't
WHY drupal_execute doesn't work
and a possible lead on static variables?
And a confirmation of the #validate hunch
All from this morning in #drupal on IRC.
Post new comment