Add logging to unexpected case in Content\Nav

- Address part of https://github.com/friendica/friendica/issues/8475#issuecomment-653912096
This commit is contained in:
Hypolite Petovan 2020-07-08 09:56:40 -04:00
parent 1f0b7690eb
commit 68ecbcea34

View file

@ -171,6 +171,7 @@ class Nav
}
if (local_user()) {
if (!empty($a->user)) {
// user menu
$nav['usermenu'][] = ['profile/' . $a->user['nickname'], DI::l10n()->t('Status'), '', DI::l10n()->t('Your posts and conversations')];
$nav['usermenu'][] = ['profile/' . $a->user['nickname'] . '/profile', DI::l10n()->t('Profile'), '', DI::l10n()->t('Your profile page')];
@ -185,6 +186,9 @@ class Nav
'icon' => (DBA::isResult($contact) ? DI::baseUrl()->remove($contact['micro']) : 'images/person-48.jpg'),
'name' => $a->user['username'],
];
} else {
DI::logger()->warning('Empty $a->user for local user'. ['local_user' => local_user(), '$a' => $a]);
}
}
// "Home" should also take you home from an authenticated remote profile connection