diff --git a/application/Espo/Core/Utils/Route.php b/application/Espo/Core/Utils/Route.php index 1c3eeac512..87071210f1 100644 --- a/application/Espo/Core/Utils/Route.php +++ b/application/Espo/Core/Utils/Route.php @@ -112,17 +112,27 @@ class Route } } + /** + * Unify routes + * + * @return array + */ protected function unify() { - $data = array(); - - $data = $this->getAddData($data, $this->paths['customPath']); + // for custom + $data = $this->getAddData([], $this->paths['customPath']); + // for module + $moduleData = []; foreach ($this->getMetadata()->getModuleList() as $moduleName) { $modulePath = str_replace('{*}', $moduleName, $this->paths['modulePath']); - $data = $this->getAddData($data, $modulePath); + foreach ($this->getAddData([], $modulePath) as $row) { + $moduleData[$row['method'].$row['route']] = $row; + } } + $data = array_merge($data, array_values($moduleData)); + // for core $data = $this->getAddData($data, $this->paths['corePath']); return $data;