On some occasions, I get a phptemplate_username error. The only reproducible occasion I've seen is when you get a locked document error from the checkout module.

error:
* warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'phptemplate_username' was given in /var/www/includes/theme.inc on line 597.
* This document is locked for editing by since September 3, 2008 - 15:04.
Click here to check back in now.

The theme call looks right to me: $username = theme('username', $lock);
and the realname phptemplate_username function is never called.

Comments

binford2k’s picture

More thought about this: are error messages generated before the theming code is loaded?

TyraelTLK’s picture

I have this problem after i disabled "Override username theme".

nancydru’s picture

Status: Active » Fixed

You need to clear the cache to reset the themeing system. Try admin >> site configuration >> performance or Devel.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

liliplanet’s picture

Status: Closed (fixed) » Active

Hi,

Strangely I'm getting the same error as follows:

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'phptemplate_username' was given in /home/public_html/includes/theme.inc on line 617.

This only happens with http://drupal.org/project/path_access

Perhaps any suggestions please?

Look forward to hearing from you.
Lilian

UPDATE FIXED: Done by disabling 'Override username theme', rebuilding permissions and emptying cache :)

nancydru’s picture

Status: Active » Fixed
jmonster’s picture

Version: 6.x-1.x-dev » 6.x-1.1-rc2

Status: Fixed » Closed (fixed)

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

mikekrese’s picture

I got the same message when I upgraded from Acquia Slate 6.x-1.4 to 6.x-2.0. To further complicate matters, after I moved my website from localhost to my test site, I can no longer login to my website.

I noticed your previous comment to empty cache (I have cache disabled). I'm not sure how to "override username theme" and "rebuild permissions."

Any suggestions would be appreciated.

Mike

•warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'phptemplate_username' was given in

nancydru’s picture

Using the setting to disable the cache does not stop all caching. Go to admin/settings/performance and click the button to clear the cache. Or go into the database and TRUNCATE all cache tables.