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.

CommentFileSizeAuthor
textareacruft.patch1.08 KBbdragon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Stupidly old crap confirmed. Works as advertised. RTBC

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Indeed, cols is a required attribute. Committed, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)