This issue tracks the removal of @bug in captcha.module and the fixing of the problem.

* @bug
* In some situations the placement of the captcha just above the submit button
* fails.
* For example: on node forms it can't be done because the node form uses a
* custom theme function. (@see includes/form/inc::theme_node_form)

CommentFileSizeAuthor
#2 placementbug.png27.16 KBsoxofaan
captcha.module_4.patch887 bytesrobloach

Comments

robloach’s picture

Status: Active » Postponed (maintainer needs more info)

I removed the @bug documentation so we'll now track it in this issue. Does this problem still persist? I haven't been able to reproduce it.

soxofaan’s picture

Title: Placement of Captcha Form Fails » Placement of CAPTCHA just above buttons fails on create node forms
StatusFileSize
new27.16 KB

Screenshot of "bug": the CAPTCHA administration links are not placed directly above the buttons. "Authoring info" and "publishing options" are squeezed between them. This is for the site administrator. Untrusted users probably have not enough rights to see the authoring and publishing options, so it's not a big problem.

Reason for the bug: the create node form uses a custom theming function which groups the "authoring info", "publishing options" and the buttons. See /modules/node/node.module, function theme_node_form() (around line 2146):

function theme_node_form($form) {
  $output = "\n<div class=\"node-form\">\n";

  // Admin form fields and submit buttons must be rendered first, because
  // they need to go to the bottom of the form, and so should not be part of
  // the catch-all call to drupal_render().
  $admin = '';
  if (isset($form['author'])) {
    $admin .= "    <div class=\"authored\">\n";
    $admin .= drupal_render($form['author']);
    $admin .= "    </div>\n";
  }
  if (isset($form['options'])) {
    $admin .= "    <div class=\"options\">\n";
    $admin .= drupal_render($form['options']);
    $admin .= "    </div>\n";
  }
  $buttons = drupal_render($form['preview']);
  $buttons .= drupal_render($form['submit']);
  $buttons .= isset($form['delete']) ? drupal_render($form['delete']) : '';

  // Everything else gets rendered here, and is displayed before the admin form
  // field and the submit buttons.
  $output .= "  <div class=\"standard\">\n";
  $output .= drupal_render($form);
  $output .= "  </div>\n";

  if (!empty($admin)) {
    $output .= "  <div class=\"admin\">\n";
    $output .= $admin;
    $output .= "  </div>\n";
  }
  $output .= $buttons;
  $output .= "</div>\n";

  return $output;
}


I would label this issue as won't fix however. It would be very messy to fix this and it's not worth the trouble IMHO.

robloach’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Yeah, not really worth it. If anyone wants to itch their own back, please be kind and submit a patch!