From 160aed817a4782341d856cb1277c5e75cfb46f31 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Mon, 21 Dec 2020 12:47:09 -0500 Subject: [PATCH] move non-compliant trigger_error out of logging --- CRM/Core/Error.php | 3 +++ CRM/Core/Error/Log.php | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index 1aa9733b5d..0d15f3006e 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -1047,7 +1047,10 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @param string $message */ public static function deprecatedWarning($message) { + // Even though the tag is no longer used within the log() function, + // \Civi\API\LogObserver instances may still be monitoring it. Civi::log()->warning($message, ['civi.tag' => 'deprecated']); + trigger_error($message, E_USER_DEPRECATED); } } diff --git a/CRM/Core/Error/Log.php b/CRM/Core/Error/Log.php index 6b7fd20c8e..de619aaee0 100644 --- a/CRM/Core/Error/Log.php +++ b/CRM/Core/Error/Log.php @@ -53,10 +53,6 @@ class CRM_Core_Error_Log extends \Psr\Log\AbstractLogger { $context['exception'] = CRM_Core_Error::formatTextException($context['exception']); } $message .= "\n" . print_r($context, 1); - - if (CRM_Utils_System::isDevelopment() && CRM_Utils_Array::value('civi.tag', $context) === 'deprecated') { - trigger_error($message, E_USER_DEPRECATED); - } } CRM_Core_Error::debug_log_message($message, FALSE, '', $this->map[$level]); } -- 2.25.1