Drupal 5 Version not Valid XHTML 1.0 Strict

andregriffin - June 12, 2008 - 17:02
Project:Framework
Version:5.x-1.9
Component:Code
Category:bug report
Priority:normal
Assigned:andregriffin
Status:closed
Description

If you have search elements enabled for Framework, a Drupal 5 bug will create this validation error: "ID "edit-submit" already defined"

The following code can be added to the bottom of template.php to fix this.

/**
* Fixes illegal duplicate html id's "edit-sumit".
*/
function phptemplate_submit($element) {
  static $dupe_ids = array();
  if (isset($dupe_ids[$element['#id']])) {
    $dupe_ids[$element['#id']]++;
    $element['#id'] = $element['#id'] .'-'. $dupe_ids[$element['#id']];
  }
  else {
    $dupe_ids[$element['#id']] = 0;
  }
  return theme('button', $element);
}

Credit: http://drupal.org/node/243249#comment-823238

#1

Anonymous (not verified) - June 26, 2008 - 17:13
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.