From a52917776bd4949da8d24cb04d31197a8f91c300 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 20 Jul 2017 19:53:38 -0700 Subject: [PATCH] CRM-20932 - CRM_Utils_System_Joomla - Fix warning. Define JDEBUG Background ========== When running `cv en ` on Joomla, there are repeated warnings, "Use of undefined constant JDEBUG", and each includes a backtrace. This is hard to read. The bug appears to affect backend scripts; it's discussed with a solution in: https://github.com/joomla/joomla-cms/issues/11512#issuecomment-244937966 Before ====== `CRM_Utils_System_Joomla::loadBootStrap()` loads various config files. However, these may or may not set `JDEBUG`. After ===== `CRM_Utils_System_Joomla::loadBootStrap()` defensively sets `JDEBUG` if no other part of the bootstrap has done so. --- CRM/Utils/System/Joomla.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index 5f3995c3d0..5d7b826457 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -559,6 +559,10 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { jimport('joomla.application.cli'); + if (!defined('JDEBUG')) { + define('JDEBUG', FALSE); + } + // CRM-14281 Joomla wasn't available during bootstrap, so hook_civicrm_config never executes. $config = CRM_Core_Config::singleton(); CRM_Utils_Hook::config($config); -- 2.25.1