Skip to content

Commit

Permalink
CRM-20932 - CRM_Utils_System_Joomla - Fix warning. Define JDEBUG
Browse files Browse the repository at this point in the history
Background
==========

When running `cv en <extname>` 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:

joomla/joomla-cms#11512 (comment)

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.
  • Loading branch information
totten committed Jul 21, 2017
1 parent 79ce1b5 commit a529177
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CRM/Utils/System/Joomla.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@ public function loadBootStrap($params = array(), $loadUser = TRUE, $throwError =

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);
Expand Down

0 comments on commit a529177

Please sign in to comment.