[drupal-devel] [bug] Form element labels should not show a : if the label ends in a '?'

Steven drupal-devel at drupal.org
Tue Jun 7 19:13:06 UTC 2005


Issue status update for http://drupal.org/node/24482

 Project:      Drupal
 Version:      cvs
 Component:    theme system
 Category:     bug reports
 Priority:     minor
 Assigned to:  Anonymous
 Reported by:  rbarreca
 Updated by:   Steven
 Status:       patch

This patch isn't very flexible as it only deals with question marks, and
ASCII ones at that. A better solution would be one that checks for any
punctuation at the end (character class Po), but then we'd get people
complaining about their PCRE not supporting Unicode again.


Still, I can't think of any situation inside Drupal where we have a
question mark at the end of a label. It is not something I'd advise in
any case. Instead of "Are you a smoker?" we tend to have a checkbox "I
am a smoker.".


As it is a themable function, I'm leaning towards not committing it.


About the actual code, I think substr($label, -1) would be a more
readable version of selecting the last byte.




Steven



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

June 7, 2005 - 19:31 : rbarreca

Attachment: http://drupal.org/files/issues/patch_no_colon_after_question_mark.patch (710 bytes)

Not sure if this goes under theme system or other.  


When fields end in a '?', the theme_form_element function shows a label
like this "Label?:" which looks weird.  I added a patch to check if it
ends in a question mark, and if so, don't add the colon to the label.


I know this function is themeable so I could've done it there, but I
feel this should be the default behavior for all those fields like "Are
you a smoker?", "Add to front page?", etc.







More information about the drupal-devel mailing list