From 2dae8a18ef9f40d286de66e56edc8b5af93da6c8 Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Thu, 29 Aug 2019 11:47:29 +0930 Subject: [PATCH] Remove Joomla-specific error handling --- CRM/Core/Error.php | 11 +++-------- CRM/Utils/System/Joomla.php | 17 ----------------- templates/CRM/common/fatal.tpl | 4 ++-- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index ea1dc1d0e3b..e52e51515a2 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -466,17 +466,12 @@ function_exists($config->fatalErrorHandler) $template = CRM_Core_Smarty::singleton(); $template->assign($vars); $content = $template->fetch('CRM/common/fatal.tpl'); + if ($config->backtrace) { $content = self::formatHtmlException($exception) . $content; } - if ($config->userFramework == 'Joomla' && - class_exists('JError') - ) { - JError::raiseError('CiviCRM-001', $content); - } - else { - echo CRM_Utils_System::theme($content); - } + + echo CRM_Utils_System::theme($content); // fin self::abend(CRM_Core_Error::FATAL_ERROR); diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index 030b73cc6c8..4fd07e84d0c 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -833,23 +833,6 @@ public function checkPermissionAddUser() { } } - /** - * Output code from error function. - * @param string $content - */ - public function outputError($content) { - if (class_exists('JErrorPage')) { - $error = new Exception($content); - JErrorPage::render($error); - } - elseif (class_exists('JError')) { - JError::raiseError('CiviCRM-001', $content); - } - else { - parent::outputError($content); - } - } - /** * @inheritDoc */ diff --git a/templates/CRM/common/fatal.tpl b/templates/CRM/common/fatal.tpl index 321402ac84b..61ba067007e 100644 --- a/templates/CRM/common/fatal.tpl +++ b/templates/CRM/common/fatal.tpl @@ -24,7 +24,7 @@ +--------------------------------------------------------------------+ *} {* error.tpl: Display page for fatal errors. Provides complete HTML doc.*} -{if $config->userFramework != 'Joomla' and $config->userFramework != 'WordPress'} +{if $config->userFramework != 'WordPress'} @@ -89,7 +89,7 @@ function toggle( element ) { } {/literal} -{if $config->userFramework != 'Joomla' and $config->userFramework != 'WordPress'} +{if $config->userFramework != 'WordPress'} {/if}