mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-28 10:53:39 +01:00
fix TypeError: Argument 1 passed to EGroupware\Api\Accounts::username() must be of the type int, null given
This commit is contained in:
parent
088dab168c
commit
a599f9390c
@ -595,11 +595,15 @@ class Accounts
|
||||
/**
|
||||
* Return formatted username for a given account_id
|
||||
*
|
||||
* @param int $account_id account id
|
||||
* @param ?int $account_id account id, default current user
|
||||
* @return string full name of user or "#$account_id" if user not found
|
||||
*/
|
||||
static function username(int $account_id)
|
||||
static function username(int $account_id=null)
|
||||
{
|
||||
if (empty($account_id))
|
||||
{
|
||||
$account_id = $GLOBALS['egw_info']['user']['account_id'];
|
||||
}
|
||||
if (!($account = self::cache_read($account_id)))
|
||||
{
|
||||
return '#'.$account_id;
|
||||
|
Loading…
Reference in New Issue
Block a user