I have some fields in my form set up something like this:
$form['details'] = array(
'#type' => 'fieldset',
'#title' => t('Details'),
'#tree' => FALSE,
);
$form['details']['left'] = array(
'#prefix' => '<div class="left">',
'#suffix' => '</div>',
'#tree' => FALSE,
);
$form['details']['left']['duration'] = array(
'#type' => 'textfield',
'#title' => "Time to Enter",
'#default_value' => $node->duration,
'#required' => TRUE,
);
Any elements set up inside of $form['details']['left'] do not show up but are filtered out automatically.
If I edit the field, for example by changing the 'duration' field to as follows:
$form['duration'] = array(
'#type' => 'textfield',
'#title' => "Time to Enter",
'#default_value' => $node->duration,
'#required' => TRUE,
);
Then the field 'duration' will appear on the form as intended.
I think the conflict occurs inside of the function formfilter_filter_form around line 184.
These lines:
foreach (element_children($form) as $key) {
if (!in_array($key, $filtered)) {
_formfilter_filter_element($form[$key]);
}
}
appear to loop through anything in $form that doesn't start with a '#'. So, it will run through 'details', but it seems to skip the items nested inside of 'details' such as, in this example, 'duration'.
What should I do to allow the formfilter module to include fields which are nested such as $form['details']['left']['duration'] ?
Comments
Comment #1
pianomansam commentedCleaning up old issues. D5 release is no longer supported. Please direct feature requests to D6 release.