API page: https://api.drupal.org/api/drupal/includes%21form.inc/function/theme_che...

Hello,
In the comment, i think the parameter #title is no correct, #name is better no?
#id is missing and #value is useless.

Comments

jhodgdon’s picture

Title: theme_checkbox() : Few errors in comments » api.drupal.org comment - theme_checkbox() : Few errors in comments
Project: Drupal core » Drupal.org site moderators
Version: 7.x-dev »
Component: documentation » API.drupal.org
Category: bug » task

If a comment is wrong, you can reply to the comment and describe the problem. If it's completely misleading... well I'm moving this to the moderation issue queue just in case.

NerOcrO’s picture

It's a misunderstanding :)
I was talking about comment of function !

/**
 * Returns HTML for a checkbox form element.
 *
 * @param $variables
 *   An associative array containing:
 *   - element: An associative array containing the properties of the element.
 *     Properties used: #title, #value, #return_value, #description, #required,
 *     #attributes, #checked.
 *
 * @ingroup themeable
 */

#id is missing
#value is useless
#title => #name

jhodgdon’s picture

Title: api.drupal.org comment - theme_checkbox() : Few errors in comments » theme_checkbox() docs have errors
Project: Drupal.org site moderators » Drupal core
Version: » 7.x-dev
Component: API.drupal.org » documentation
Category: Task » Bug report
Priority: Minor » Normal
Issue summary: View changes
Issue tags: -checkbox

Hey, sorry, I was just going through some old issues and found this. Moving to Drupal Core because when there are issues in the documentation we need to fix it in Drupal Core.

mpv’s picture

Here's a patch with the suggested changes:

  • Added #id
  • Removed #value
  • Renamed #title to #name
jhodgdon’s picture

Status: Active » Needs review

Thanks! This looks correct to me according to the issue report.

However, I think the issue report is incorrect, because all form elements in Drupal use #title and #description, I think?

jhodgdon’s picture

Status: Needs review » Needs work

Although come to think of it, theme_checkbox() itself does not use #title or #description. What the function itself uses, if you look at the code, is:
#id
#name
#attributes
#checked
#return_value

So I think the patch needs a small update.

mpv’s picture

Status: Needs work » Needs review
StatusFileSize
new874 bytes

That's right, I missed required and description. The only properties used are the ones you mentioned in #6. I think it's ok now.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks again! Committed to 7.x.

Status: Fixed » Closed (fixed)

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