Incorrect CSS class for form element wrappers

asimmonds - July 4, 2009 - 23:14
Project:Drupal
Version:7.x-dev
Component:forms system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

This is a bug related to issue #43493: FAPI: Add name/type as CSS class for form elements.

If a form element name has a embedded space, then the resulting CSS class would be incorrect for the form element wrapper.
This can be seen on the permissions page when the book module is enabled, the "Create new books" permission's checkboxes are pushed to the right, out of the column (see attached image).
This is due to the class being "form-item form-item-checkbox 1-create new books-wrapper" instead of something like "form-item form-item-checkbox 1-create-new-books-wrapper"

The attached patch adds a space to dash conversion to the special character conversion list for the CSS class string.

AttachmentSizeStatusTest resultOperations
form-inc-space-to-dash.patch756 bytesIdlePassed: 11563 passes, 0 fails, 0 exceptionsView details
permissions_book_bad_css_class.png4.6 KBIgnoredNoneNone

#1

tobiasb - July 5, 2009 - 08:31
Status:needs review» reviewed & tested by the community

#2

Dries - July 5, 2009 - 18:02
Status:reviewed & tested by the community» fixed

Committed to CVS HEAD. Thanks!

#3

System Message - July 19, 2009 - 18:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.