Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By aleksey.tk on
Seems to me that i found a bug. Wherever you name a form element like:
//Problem #1
$form['element name with spaces']
the $form_values variable (in validate and submit hooks) gets empty for this element.
Also:
//Problem #2
$form["check"] = array(
'#type' => 'checkboxes',
'#title' => t('Title'),
'#description' => t('Description.'),
'#options' => array('check with space' => 'Check with space', 'check_without_space' => 'Check without space'),
);
works wrong too, 'check with space' always empty.
People, please check this issue and write what something about it. I've found solution to problem #1by adding one line to form.inc:
660 foreach ($form['#parents'] as $parent) {
661 $parent = str_replace(" ", "_", $parent); // I've added this line
662 $edit = isset($edit[$parent]) ? $edit[$parent] : NULL;
663 }
P.S. In drupal 4.7 all works great, so i think this is a bug
P.P.S. If someone already found it, please give me the link to issue, i can't find anything related to this problem on drupal.org