Skip to content

Commit

Permalink
Merge branch '4.0-dev' into workflow-preinstalled-default-category
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Jan 30, 2019
2 parents e9b8a0a + 2be151e commit 6817313
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions plugins/finder/categories/categories.php
Expand Up @@ -252,15 +252,19 @@ protected function index(FinderIndexerResult $item, $format = 'html')
return;
}

// Extract the extension element
$parts = explode('.', $item->extension);
$extension_element = $parts[0];

// Check if the extension that owns the category is also enabled.
if (ComponentHelper::isEnabled($item->extension) === false)
if (ComponentHelper::isEnabled($extension_element) === false)
{
return;
}

$item->setLanguage();

$extension = ucfirst(substr($item->extension, 4));
$extension = ucfirst(substr($extension_element, 4));

// Initialize the item parameters.
$item->params = new Registry($item->params);
Expand Down Expand Up @@ -295,7 +299,9 @@ protected function index(FinderIndexerResult $item, $format = 'html')
* Need to import component route helpers dynamically, hence the reason it's handled here.
*/
$class = $extension . 'HelperRoute';
JLoader::register($class, JPATH_SITE . '/components/' . $item->extension . '/helpers/route.php');

// Need to import component route helpers dynamically, hence the reason it's handled here.
JLoader::register($class, JPATH_SITE . '/components/' . $extension_element . '/helpers/route.php');

if (class_exists($class) && method_exists($class, 'getCategoryRoute'))
{
Expand Down

0 comments on commit 6817313

Please sign in to comment.