diff --git a/libraries/cms/component/helper.php b/libraries/cms/component/helper.php index 1b87717919e54..7d44b1576ad1c 100644 --- a/libraries/cms/component/helper.php +++ b/libraries/cms/component/helper.php @@ -338,9 +338,20 @@ public static function renderComponent($option, $params = array()) $file = substr($option, 4); // Define component path. - define('JPATH_COMPONENT', JPATH_BASE . '/components/' . $option); - define('JPATH_COMPONENT_SITE', JPATH_SITE . '/components/' . $option); - define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/' . $option); + if (!defined('JPATH_COMPONENT')) + { + define('JPATH_COMPONENT', JPATH_BASE . '/components/' . $option); + } + + if (!defined('JPATH_COMPONENT_SITE')) + { + define('JPATH_COMPONENT_SITE', JPATH_SITE . '/components/' . $option); + } + + if (!defined('JPATH_COMPONENT_ADMINISTRATOR')) + { + define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/' . $option); + } $path = JPATH_COMPONENT . '/' . $file . '.php';