Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions libraries/src/Helper/ModuleHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ public static function getLayoutPath($module, $layout = 'default')
$templateObj = Factory::getApplication()->getTemplate(true);
$defaultLayout = $layout;
$template = $templateObj->template;
$base = Factory::getApplication()->getClientId() === 3 ? JPATH_SITE : JPATH_BASE;

if (str_contains($layout, ':')) {
// Get the template and file name from the string
Expand All @@ -327,13 +328,13 @@ public static function getLayoutPath($module, $layout = 'default')
$defaultLayout = $temp[1] ?: 'default';
}

$dPath = JPATH_BASE . '/modules/' . $module . '/tmpl/default.php';
$dPath = $base . '/modules/' . $module . '/tmpl/default.php';

try {
// Build the template and base path for the layout
$tPath = Path::check(JPATH_THEMES . '/' . $template . '/html/' . $module . '/' . $layout . '.php');
$iPath = Path::check(JPATH_THEMES . '/' . $templateObj->parent . '/html/' . $module . '/' . $layout . '.php');
$bPath = Path::check(JPATH_BASE . '/modules/' . $module . '/tmpl/' . $defaultLayout . '.php');
$bPath = Path::check($base . '/modules/' . $module . '/tmpl/' . $defaultLayout . '.php');
} catch (\Exception) {
// On error fallback to the default path
return $dPath;
Expand Down Expand Up @@ -406,6 +407,10 @@ public static function getModuleList()
$itemId = $app->getInput()->getInt('Itemid', 0);
$groups = $app->getIdentity()->getAuthorisedViewLevels();
$clientId = (int) $app->getClientId();
if ($clientId === 3)
{
$clientId = 0;
}

// Build a cache ID for the resulting data object
$cacheId = implode(',', $groups) . '.' . $clientId . '.' . $itemId;
Expand Down