Interim almost have ability to add onto a form before post
Actually, Agaric can add onto the form before submitting with this code in form_alter, action_node_form hook, to catch and stop repeats of drupal_execute.
if (isset($form['#post']['already_submitted']['#value'])) {
unset($form['#submit']);
$form['#submit']['node_form_submit'] = array();
...
return;
}
But we can't seem to add onto the subform from this place, after the user has put in their data, but before the forms are submitted for real, and the data saved.
(Fairly certain we could make a custom form, and drupal_execute parts of it separately with this catch and release system, so if there's no follow-up post, that's your take-away!)
We're not ready for the big "understand everything" post, so here are a few more meandering byways on our way to an answer:
drupal set redirect
THE question is whether we have a program issue or if it's just that we need action enabled in OG to be added to the group.
Your Action group has been created.
this nid 268
nid nodeapi 268
Your Action has been created.
Says the latter.
It is indeed the latter.
So no question we have to work around organic groups' dislike of
drupal_set_message('
? ' . print_r($form, TRUE) . '
');
if (isset($form['og_group_embedded'])) {
$simple = TRUE;
}
doesn't work because -- I think -- wsf_action is a heavy weighted module, so it's form_alter runs after
adding it to the element that calls the subform
$form['action_group'] = array(
'#type' => 'subform',
'#id' => 'action_group_node_form',
'#arguments' => array(array(
'uid' => $uid,
'type' => 'action_group',
'og_embedded' => TRUE,
)),
'#after_build' => array(
'subform_element_build_subform',
'wsf_action_fix_subform',
),
'#data_separation' => TRUE,
'#weight' => -40,
);
didn't work
Neither did anything I added to my after_build function do anything.
Resolution
More like this
- Add onto a form from other sources (like a subform) before submitting
- Add action form print_r dump - for easy reference for form_alter and form theming
- Notes on the Taxonomy Code Sprint to turn into a Drupal planet post soon enough
- Storing lots of little pieces of data for a module: best practices? Interim practices?
- Subform Element does not allow passing of nid information to subsequent forms


Comments
Post new comment