Use theme_username() to allow theme overrides and modules like RealName to influence username defaults in submission form.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jcnventura’s picture

Status: Needs review » Needs work

Why are you calling the theme function twice?

aether’s picture

Status: Needs work » Needs review
FileSize
662 bytes

Now only called one time.

jcnventura’s picture

Status: Needs review » Needs work

The default implementation of theme_username() doesn't accept the plain argument and it returns the HTML pointing to the user page. Since the instances where this string is used require simple text, this patch is unacceptable.

aether’s picture

Status: Needs work » Needs review
FileSize
663 bytes

Ah, right you are. My implementation was specifically related to the RealName module which provides this argument via override. Would strip_tags offer an acceptable workaround as it is used in this patch or is it bad practice to wrap a theme function like this?

Not sure if the check_plain is needed here and will remove it if it is unnecessary in your opinion and the patch is otherwise acceptable.

jcnventura’s picture

Status: Needs review » Fixed

Commited to CVS. Thanks for the patch!

Status: Fixed » Closed (fixed)

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