diff --git a/classes/module/Module.php b/classes/module/Module.php index 5dd18e9d6..3ca653693 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -2874,15 +2874,17 @@ abstract class ModuleCore $overrides = array(); foreach (Tools::scandir($this->getLocalPath().'override', 'php', '', true) as $file) { $class = basename($file, '.php'); - $classInfo = array('class' => $class, 'file' => $file, 'type' => null); - if (PrestaShopAutoload::getInstance()->getClassPath($class.'Core')) { - $classInfo['type'] = self::OVERRIDE_TYPE_CORE; - } elseif (Module::getModuleIdByName($class)) { - $classInfo['type'] = self::OVERRIDE_TYPE_MODULE; - } elseif (preg_match('#^modules/([a-zA-Z0-9_-]+)/controllers/(admin|front)/([0-9a-zA-Z-_]+).php#', $file, $matches)) { - $classInfo['type'] = self::OVERRIDE_TYPE_MODULE_CONTROLLER; - $classInfo['module'] = $matches[1]; - $classInfo['controller_type'] = $matches[2]; + if ($class != 'index') { + $classInfo = array('class' => $class, 'file' => $file, 'type' => null); + if (PrestaShopAutoload::getInstance()->getClassPath($class.'Core')) { + $classInfo['type'] = self::OVERRIDE_TYPE_CORE; + } elseif (Module::getModuleIdByName($class)) { + $classInfo['type'] = self::OVERRIDE_TYPE_MODULE; + } elseif (preg_match('#^modules/([a-zA-Z0-9_-]+)/controllers/(admin|front)/([0-9a-zA-Z-_]+).php#', $file, $matches)) { + $classInfo['type'] = self::OVERRIDE_TYPE_MODULE_CONTROLLER; + $classInfo['module'] = $matches[1]; + $classInfo['controller_type'] = $matches[2]; + } } if ($classInfo['type']) {