The string "required" is repeated five times below the admin/modules table (matching up with the number of required modules). This shouldn't be there.

CommentFileSizeAuthor
#3 forms3.patch1008 byteschx
#2 require_suffix.patch715 bytesjakeg

Comments

jakeg’s picture

Status: Active » Needs review

Could it be to do with the 'suffix' not being part of the 'content' and hence not counted as actual output in the if statement?

line 577+ in form.inc...

if (!$content) {
  foreach (element_children($elements) as $key) {
    $content .= form_render($elements[$key]);
  }
}

could become

if (!$content) {
  foreach (element_children($elements) as $key) {
    if(!$elements[$key][suffix] && !$elements[$key][prefix]) {
      $content .= form_render($elements[$key]);
    }
  }
}

... works, but is this the best way/what we're trying to do?

jakeg’s picture

StatusFileSize
new715 bytes

Okay, my first ever go at making a patch. here it is. let me know if i've done anything wrong.

chx’s picture

Assigned: Unassigned » chx
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1008 bytes

The problem is that when the final form_render is called, we take care of not rendering the elements again but the prefix and suffix is not checked for this. See the simple fix in the patch.

Also included is a minor fix to make code more elegant.

chx’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)