Skip to content

Commit

Permalink
✨ Be sure URL of MBO is the correct one on the dependencies array
Browse files Browse the repository at this point in the history
  • Loading branch information
intraordinaire committed Jul 5, 2024
1 parent d9bfc0b commit 527b539
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/DependencyBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,16 @@ protected function buildRoutesForModule($moduleName)
{
$urls = [];
foreach (['install', 'enable', 'upgrade'] as $action) {
$route = $this->router->generate('admin_module_manage_action', [
'action' => $action,
'module_name' => $moduleName,
]);
if ($action === 'install' && $moduleName === 'ps_mbo' && !empty($_SERVER['REQUEST_URI'])) {
$query = http_build_query(array_merge($_GET, [self::GET_PARAMETER => '1']));
$baseUri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$route = $baseUri . '?' . $query;
} else {
$route = $this->router->generate('admin_module_manage_action', [
'action' => $action,
'module_name' => $moduleName,
]);
}

if (is_string($route)) {
$urls[$action] = $route;
Expand Down

0 comments on commit 527b539

Please sign in to comment.