The $cols = $element['#cols'] ? ' cols="'. $element['#cols'] .'"' : '';
line in theme_textarea() does not need to be there. #cols has a default, and you'd have to explicitly set it to 0 or null or something to get this line to mean anything. Doing so will then produce invalid html, as cols is a required attribute.
I traced this line back to its introduction in revision 1.210 of includes/common.inc (4 years, 4 months ago).
http://cvs.drupal.org/viewvc.py/drupal/drupal/includes/common.inc?r1=1.2...
Doesn't even seem particularly valid HERE, as $cols is not an optional parameter to the function... Were people setting it to 0 at one point?
Anything relying on this line in these modern days needs a head exam.
Comment | File | Size | Author |
---|---|---|---|
textareacruft.patch | 1.08 KB | bdragon | |
Comments
Comment #1
Wim LeersStupidly old crap confirmed. Works as advertised. RTBC
Comment #2
Gábor HojtsyIndeed, cols is a required attribute. Committed, thanks.
Comment #3
(not verified) CreditAttribution: commented