diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index e0d5a622a1..5cb975e96a 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -5091,6 +5091,12 @@ function api_get_language_info($languageId) function api_get_visual_theme() { static $visual_theme; + + // If call from CLI it should be reload. + if ('cli' === PHP_SAPI) { + $visual_theme = null; + } + if (!isset($visual_theme)) { $cacheAvailable = api_get_configuration_value('apc'); $userThemeAvailable = api_get_setting('user_selected_theme') == 'true'; diff --git a/src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php b/src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php index 72d784d3d5..cd29cd18dd 100644 --- a/src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php +++ b/src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php @@ -79,6 +79,12 @@ class ChamiloApi public static function getPlatformLogoPath($theme = '', $getSysPath = false) { static $logoPath; + + // If call from CLI it should be reload. + if ('cli' === PHP_SAPI) { + $logoPath = null; + } + if (!isset($logoPath)) { $theme = empty($theme) ? api_get_visual_theme() : $theme; $accessUrlId = api_get_current_access_url_id(); @@ -86,7 +92,7 @@ class ChamiloApi $customLogoPath = $themeDir."images/header-logo-custom$accessUrlId.png"; $svgIcons = api_get_setting('icons_mode_svg'); - if ($svgIcons == 'true') { + if ($svgIcons === 'true') { $customLogoPathSVG = substr($customLogoPath, 0, -3).'svg'; if (file_exists(api_get_path(SYS_PUBLIC_PATH)."css/$customLogoPathSVG")) { if ($getSysPath) {