From 67344d0e66e67d02e91f1bb4f1776bee75b93bce Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 19 Jun 2020 14:24:29 +0200 Subject: [PATCH] Fix email logo when sending via a cron script BT#17386 --- main/cron/scheduled_announcement.php | 10 +++++----- src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php | 9 ++++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/main/cron/scheduled_announcement.php b/main/cron/scheduled_announcement.php index 59d2e307f2..84cf8c64d0 100644 --- a/main/cron/scheduled_announcement.php +++ b/main/cron/scheduled_announcement.php @@ -1,14 +1,14 @@ sendPendingMessages($url['id']); + $messagesSent = $object->sendPendingMessages($urlId); echo "Messages sent $messagesSent".PHP_EOL; } diff --git a/src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php b/src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php index cd29cd18dd..4f0c276e51 100644 --- a/src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php +++ b/src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php @@ -88,6 +88,12 @@ class ChamiloApi if (!isset($logoPath)) { $theme = empty($theme) ? api_get_visual_theme() : $theme; $accessUrlId = api_get_current_access_url_id(); + if ('cli' === PHP_SAPI) { + $accessUrl = api_get_configuration_value('access_url'); + if (!empty($accessUrl)) { + $accessUrlId = $accessUrl; + } + } $themeDir = \Template::getThemeDir($theme); $customLogoPath = $themeDir."images/header-logo-custom$accessUrlId.png"; @@ -118,7 +124,7 @@ class ChamiloApi } $originalLogoPath = $themeDir."images/header-logo.png"; - if ($svgIcons == 'true') { + if ($svgIcons === 'true') { $originalLogoPathSVG = $themeDir."images/header-logo.svg"; if (file_exists(api_get_path(SYS_CSS_PATH).$originalLogoPathSVG)) { if ($getSysPath) { @@ -131,6 +137,7 @@ class ChamiloApi return $logoPath; } } + if (file_exists(api_get_path(SYS_CSS_PATH).$originalLogoPath)) { if ($getSysPath) { $logoPath = api_get_path(SYS_CSS_PATH).$originalLogoPath;