Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
theme('username', drupal_anonymous_user())
produces the notice above because the name member is not set.
I propose adding the highlighted line below:
function drupal_anonymous_user($session = '') {
$user = new stdClass();
$user->uid = 0;
$user->name = ''; // Can we add this line?
$user->hostname = ip_address();
$user->roles = array();
$user->roles[DRUPAL_ANONYMOUS_RID] = 'anonymous user';
$user->session = $session;
$user->cache = 0;
return $user;
}
Comment | File | Size | Author |
---|---|---|---|
#1 | drupal_anonymous_user.1185666.1.patch | 449 bytes | salvis |
Comments
Comment #1
salvis