Drupal 6 Search module double ID's I'm currently busy with a website for a costumer. This website has to be W3C validated. There was a problem on the search page of the site with a double ID:

&lt;div class="form-item" id="edit-keys-wrapper"&gt;
  &lt;label for="edit-keys"&gt;Enter your keywords: &lt;/label&gt;
  &lt;div class="container-inline"&gt;&lt;div class="form-item" id="edit-keys-wrapper"&gt;
  &lt;input type="text" maxlength="255" name="keys" id="edit-keys" size="40" value="" class="form-text" /&gt;
&lt;/div&gt;


The ID: id="edit-keys-wrapper" comes up two times! This is not W3C allowed.

I've downloaded and installed a clean Drupal 6.28 to be sure it's not a theme error.

Is there a patch for this "problem"? If not, what is the best option to fix this without ruining core?
I can confirm this happens out of the box all the way back to at least 6.25.

You can 'fix' it pretty simply with the following code:

function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'search_form') {
    unset($form['basic']['#id']);
  }
}


That gives this markup in place of the old:

&lt;div class="form-item"&gt;
  &lt;label&gt;Enter your keywords: &lt;/label&gt;
  &lt;div class="container-inline"&gt;
    &lt;div class="form-item" id="edit-keys-wrapper"&gt;
      &lt;input type="text" maxlength="255" name="keys" id="edit-keys" size="40" value="book" class="form-text error"&gt;
    &lt;/div&gt;
    &lt;input type="submit" name="op" id="edit-submit" value="Search" class="form-submit"&gt;
  &lt;/div&gt;
&lt;/div&gt;