diff --git a/administrator/components/com_templates/src/Model/TemplateModel.php b/administrator/components/com_templates/src/Model/TemplateModel.php index fa45856ff0bea..fe2f998e17d02 100644 --- a/administrator/components/com_templates/src/Model/TemplateModel.php +++ b/administrator/components/com_templates/src/Model/TemplateModel.php @@ -489,6 +489,7 @@ public function getCoreFile($file, $client_id) $componentPath = Path::clean($client->path . '/components/'); $modulePath = Path::clean($client->path . '/modules/'); $layoutPath = Path::clean(JPATH_ROOT . '/layouts/'); + $pluginPath = Path::clean(JPATH_ROOT . '/plugins/'); // For modules if (stristr($type, 'mod_') !== false) { @@ -500,6 +501,18 @@ public function getCoreFile($file, $client_id) return $coreFile; } + // For plugins + if (stristr($type, 'plg_') !== false) { + $pluginFolder = explode('_', $explodeArray['2']); + $folder = $pluginFolder['1']; + $subFolder = $pluginFolder['2']; + $htmlPath = Path::clean($pluginPath . $folder . '/' . $subFolder . '/tmpl/'); + $fileName = $this->getSafeName($fileName); + $coreFile = Path::find($htmlPath, $fileName); + + return $coreFile; + } + if (stristr($type, 'com_') !== false) { // For components $folder = $explodeArray['2'];