From baa8bba92696427709b86dcf6c46332503b89c1e Mon Sep 17 00:00:00 2001 From: Benjamin Dalsass <95754414+bdalsass@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:50:58 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B08031=20-=20Make=20all=20portal=20bricks?= =?UTF-8?q?=20use=20custom=20templates=20for=20all=20templates=20add=20mis?= =?UTF-8?q?sing=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TemplatesProviderService.php | 26 +++---------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/datamodels/2.x/itop-portal-base/portal/src/Service/TemplatesProvider/TemplatesProviderService.php b/datamodels/2.x/itop-portal-base/portal/src/Service/TemplatesProvider/TemplatesProviderService.php index 53424045a..b89baeac6 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/Service/TemplatesProvider/TemplatesProviderService.php +++ b/datamodels/2.x/itop-portal-base/portal/src/Service/TemplatesProvider/TemplatesProviderService.php @@ -194,17 +194,8 @@ class TemplatesProviderService // search for the template definition $oTemplateDefinition = $this->oTemplateRegister->GetTemplateDefinition($sProviderClass, $sTemplateId); - if ($oTemplateDefinition !== null) - { - - // return the template path - return $oTemplateDefinition->GetPath($bIsInitial); - } - else - { - throw new Exception("Template definition not found for provider class `$sProviderClass` and template id `$sTemplateId` (provider is known by the service)"); - } - + // return the template path + return $oTemplateDefinition?->GetPath($bIsInitial); } else { @@ -213,18 +204,7 @@ class TemplatesProviderService // the provider class is unknown by service // the class register its templates with legacy constants - $sTemplatePath = $this->GetLegacyTemplatePath($sProviderClass, $sTemplateId); - - if ($sTemplatePath !== null) - { - - // return the template path - return $sTemplatePath; - } - else - { - throw new Exception("Template definition not found for provider class `$sProviderClass` and template id `$sTemplateId` (provider is unknown by the service)"); - } + return $this->GetLegacyTemplatePath($sProviderClass, $sTemplateId); } }