From 73ab10658c7ea5e1c10d25f690fe2ec1a93da80e Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Thu, 22 Jun 2023 12:44:04 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#1761 --- wire/core/ModulesLoader.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wire/core/ModulesLoader.php b/wire/core/ModulesLoader.php index 94bbe0e9..f0a3ba6b 100644 --- a/wire/core/ModulesLoader.php +++ b/wire/core/ModulesLoader.php @@ -486,7 +486,6 @@ class ModulesLoader extends ModulesClass { $basename = basename($basename, '.module'); $requires = array(); $duplicates = $this->modules->duplicates(); - $moduleInfo = null; // check if module has duplicate files, where one to use has already been specified to use first $currentFile = $duplicates->getCurrent($basename); // returns the current file in use, if more than one @@ -607,9 +606,8 @@ class ModulesLoader extends ModulesClass { if($module === null) { // placeholder for a module, which is not yet included and instantiated - // if(!$moduleInfo) $moduleInfo = $this->getModuleInfo($basename); - $ns = $moduleInfo ? $moduleInfo['namespace'] : $this->modules->info->moduleInfoCache($basename, 'namespace'); - if(empty($namespace)) $ns = __NAMESPACE__ . "\\"; + $ns = $this->modules->info->moduleInfoCache($basename, 'namespace'); + if(empty($ns)) $ns = __NAMESPACE__ . "\\"; $singular = $info['flags'] & Modules::flagsSingular; $module = $this->newModulePlaceholder($basename, $ns, $pathname, $singular, $autoload); }