Can you try to clean browser cache?
Unfortunately, cleaning web browser cache doesn’t help.
@Snk which type of authentication do you use and which browser?
We do use SSO authentication through OpenID. Would that be the root cause ?
Ok it is a known issue and we made a fix here.
Should be available in next minor version (22.04.5)
Hello @Snk , Do you have logs into /var/log/php-fpm/centreon-error.log when you try to display your custom views ?
Also when you say
We just need to switch light/dark theme or edit our profile to fix the issue. Maybe there’s some lack of theme initialization on login phase :/
When you logout and login again, did the bug occurs again ? (If yes indeed it could be a bug related to login, but if the bug doesn’t occurs after you have switch I think it’s more a problem during the upgrade).
I’ll investigate further
Hello again @Snk ,
After investigation I’ve found the root cause. Indeed on the login there is a little error.
If you want to patch it before we release this officialy, you can edit the following file:
/usr/share/centreon/src/EventSubscriber/WebSSOEventSubscriber.php
on ~l.246 you should see
$sessionUserInfos = f
'contact_id' => $user->getId(),
'contact_name' => $user->getName(),
'contact_alias' => $user->getAlias(),
'contact_email' => $user->getEmail(),
'contact_lang' => $user->getLang(),
'contact_passwd' => $user->getEncodedPassword(),
'contact_autologin_key' => '',
'contact_admin' => $user->isAdmin() ? '1' : '0',
'default_page' => $user->getDefaultPage(),
'contact_location' => $user->getLocale(),
'show_deprecated_pages' => $user->isUsingDeprecatedPages(),
'reach_api' => $user->hasAccessToApiConfiguration() ? 1 : 0,
'reach_api_rt' => $user->hasAccessToApiRealTime() ? 1 : 0,
];
add the following line
'contact_theme' => $user->getTheme() ?? 'light'
after
'reach_api_rt' => $user->hasAccessToApiRealTime() ? 1 : 0,
So the user theme will correctly be instanciate on login.
Hello @Jérémy Jaouen
Thanks for this but it doesn’t fix the issue for us, even after restarting both httpd & php-fpm. I’ve event tried to clean browser cache.
I’ve checked in the contact table of the centreon database, every user has “light” theme configured.
For testing purpose I’ve tried :
'contact_theme' => 'light'
But it doesn’t work either :/
I guess the fix mentionned by @Laurent will fix it for good, I’ll wait for next release (22.04.6 ?)
Ok I’ve fixed the issue by adding the fix in this file aswell :
/usr/share/centreon/src/Core/Security/Application/UseCase/LoginOpenIdSession/LoginOpenIdSession.php
Yes thought it was login using apache SSO, my bad.
A PR has been done and will be release ASAP (I guess in 22.04.6 indeed)
https://github.com/centreon/centreon/pull/11830
Thanks for your feedback, good to know it’ll be fixed in next version (I keep my local change ^^).