]> git.agnieray.net Git - galette.git/commitdiff
Fix redirection URL when conribution creation fails
authorJohan Cwiklinski <johan@x-tnd.be>
Thu, 4 Jan 2024 04:51:42 +0000 (05:51 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Fri, 5 Jan 2024 08:33:38 +0000 (09:33 +0100)
galette/lib/Galette/Controllers/Crud/ContributionsController.php

index 44be33650c038d7d3e17f28db7614eb13ac6d51f..146e37fe9addf2574787d41c5b3ac0b64317f6bc 100644 (file)
@@ -793,16 +793,16 @@ class ContributionsController extends CrudController
     public function store(Request $request, Response $response, $action, string $type, $id = null): Response
     {
         $post = $request->getParsedBody();
-        $args = [
+        $url_args = [
             'action'    => $action,
             'type'      => $type
         ];
         if ($id !== null) {
-            $args['id'] = $id;
+            $url_args['id'] = $id;
         }
 
         if ($action == 'edit' && isset($post['btnreload'])) {
-            $redirect_url = $this->routeparser->urlFor($action . 'Contribution', $args);
+            $redirect_url = $this->routeparser->urlFor($action . 'Contribution', $url_args);
             $redirect_url .= '?' . Adherent::PK . '=' . $post[Adherent::PK] . '&' .
                 ContributionsTypes::PK . '=' . $post[ContributionsTypes::PK] . '&' .
                 'montant_cotis=' . $post['montant_cotis'];
@@ -882,7 +882,7 @@ class ContributionsController extends CrudController
             //something went wrong.
             //store entity in session
             $this->session->contribution = $contrib;
-            $redirect_url = $this->routeparser->urlFor($action . 'Contribution', $args);
+            $redirect_url = $this->routeparser->urlFor($action . 'Contribution', $url_args);
 
             //report errors
             foreach ($error_detected as $error) {