Skip to content

Commit

Permalink
Accept relative URL in the batch controller
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-castelain committed Jan 9, 2025
1 parent db1f834 commit 07af802
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/controllers/batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default class extends Controller {
}

try {
href = new URL(identifierHolder.dataset[hrefHolder]);
href = new URL(identifierHolder.dataset[hrefHolder], window.location.origin);
} catch (exception) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Action/Type/ModalActionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function buildView(ActionView $view, ActionInterface $action, array $opti
}
}

$href = $options['href'] ?? $this->router->generate($options['route'], $options['route_params'], RouterInterface::ABSOLUTE_URL);
$href = $options['href'] ?? $this->router->generate($options['route'], $options['route_params']);

$view->vars = array_replace($view->vars, [
'href' => $href,
Expand Down

0 comments on commit 07af802

Please sign in to comment.