[documentation] [Documentation bug] Markup elements should not have title or description

Jaza drupal-docs at drupal.org
Sat Apr 15 04:40:12 UTC 2006


Issue status update for 
http://drupal.org/node/58698
Post a follow up: 
http://drupal.org/project/comments/add/58698

-Project:      Drupal
+Project:      Documentation
 Version:      <none>
-Component:    forms system
+Component:    Documentation in CVS
 Category:     bug reports
 Priority:     normal
 Assigned to:  Jaza
 Reported by:  Jaza
 Updated by:   Jaza
 Status:       active




Jaza



Previous comments:
------------------------------------------------------------------------

Fri, 14 Apr 2006 05:46:28 +0000 : Jaza

Attachment: http://drupal.org/files/issues/theme_markup.patch (599 bytes)

Form elements of type #markup (the default type) are allowed to have a
title and a description, according to
http://api.drupal.org/api/HEAD/file/developer/topics/forms_api_reference....
But these attributes are not outputted by theme_markup(), because it
does not have the standard call to theme('form_element').


Attached patch fixes this.




------------------------------------------------------------------------

Fri, 14 Apr 2006 05:51:37 +0000 : Jaza

Attachment: http://drupal.org/files/issues/theme_markup_0.patch (582 bytes)

Removed #id parameter from call to theme('form_element'), as this
doesn't apply for #markup.




------------------------------------------------------------------------

Fri, 14 Apr 2006 06:25:29 +0000 : Jaza

Attachment: http://drupal.org/files/issues/theme_markup_1.patch (655 bytes)

Updated to only call theme('form_element') if #title or #description are
set, because calling it for existing #markup elements in core seems to
wreck the layout of some pages (e.g. admin/modules).




------------------------------------------------------------------------

Fri, 14 Apr 2006 09:07:19 +0000 : killes at www.drop.org

This needs a review by some form API person.




------------------------------------------------------------------------

Sat, 15 Apr 2006 04:34:11 +0000 : Jaza

I have talked to chx, and it has been determined that markup elements
should never be passed through theme('form_element'), as this wraps the
element in a <div class="form-item">, which should never happen for
markup.


The conclusion is that when a title and/or a description is needed, use
type item instead of type markup. Title and description should no longer
be allowed for elements of type markup. I couldn't see anywhere in the
code that the rules of allowed attributes for form element types is
defined, so it looks like it's just the docs on api.drupal.org [1] that
need to be updated.
[1]
http://api.drupal.org/api/HEAD/file/developer/topics/forms_api_reference...






More information about the documentation mailing list