From 486f7a72c37ea04a5eeb1978bf2a8af0be9f0943 Mon Sep 17 00:00:00 2001 From: Alex Gusev Date: Tue, 15 May 2018 09:58:24 +0300 Subject: [PATCH 1/2] Error 500 in Module Manager There is an error in Module Manager (http://store.com/setup/index.php/moduleGrid/modules) if some module has no "moduleName" property: ``` { "name": "amzn\/amazon-pay-and-login-magento-2-module", "type": "magento2-module", "version": "2.0.4" } ``` --- setup/src/Magento/Setup/Model/Grid/Module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Model/Grid/Module.php b/setup/src/Magento/Setup/Model/Grid/Module.php index c5e7c514df57c..c1b5dad5d9508 100644 --- a/setup/src/Magento/Setup/Model/Grid/Module.php +++ b/setup/src/Magento/Setup/Model/Grid/Module.php @@ -178,7 +178,7 @@ private function getModulesInfo(array $moduleList) private function addGeneralInfo(array $items) { foreach ($items as &$item) { - $item['moduleName'] = $item['moduleName'] ?: $this->packageInfo->getModuleName($item['name']); + $item['moduleName'] = isset($item['moduleName']) ? $item['moduleName'] : $this->packageInfo->getModuleName($item['name']); $item['enable'] = $this->moduleList->has($item['moduleName']); $vendorSource = $item['name'] == self::UNKNOWN_PACKAGE_NAME ? $item['moduleName'] : $item['name']; $item['vendor'] = ucfirst(current(preg_split('%[/_]%', $vendorSource))); From 1b5d1d1da3c9a4c01351f5c5ac34da9691c355a5 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Mon, 21 May 2018 17:25:09 +0300 Subject: [PATCH 2/2] Fixed according to review --- setup/src/Magento/Setup/Model/Grid/Module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Model/Grid/Module.php b/setup/src/Magento/Setup/Model/Grid/Module.php index c1b5dad5d9508..fd9dc3285de3e 100644 --- a/setup/src/Magento/Setup/Model/Grid/Module.php +++ b/setup/src/Magento/Setup/Model/Grid/Module.php @@ -178,7 +178,7 @@ private function getModulesInfo(array $moduleList) private function addGeneralInfo(array $items) { foreach ($items as &$item) { - $item['moduleName'] = isset($item['moduleName']) ? $item['moduleName'] : $this->packageInfo->getModuleName($item['name']); + $item['moduleName'] = $item['moduleName'] ?? $this->packageInfo->getModuleName($item['name']); $item['enable'] = $this->moduleList->has($item['moduleName']); $vendorSource = $item['name'] == self::UNKNOWN_PACKAGE_NAME ? $item['moduleName'] : $item['name']; $item['vendor'] = ucfirst(current(preg_split('%[/_]%', $vendorSource)));