]> git.agnieray.net Git - galette.git/blobdiff - galette/lib/Galette/Controllers/Crud/DynamicFieldsController.php
Fix redirection when dynamic file does not exists
[galette.git] / galette / lib / Galette / Controllers / Crud / DynamicFieldsController.php
index e275bec0d2d218e5f8f573c54e4bbe8fcc548569..76b9522df70ce6c453f72636b26e15cc2a9006f1 100644 (file)
@@ -386,10 +386,17 @@ class DynamicFieldsController extends CrudController
                 _T("The file does not exists or cannot be read :(")
             );
 
+            $route_name = 'member';
+            if ($form_name == 'contrib') {
+                $route_name = 'contribution';
+            } elseif ($form_name == 'trans') {
+                $route_name = 'transaction';
+            }
+
             return $response
                 ->withHeader(
                     'Location',
-                    $this->routeparser->urlFor('member', ['id' => $id])
+                    $this->routeparser->urlFor($route_name, ['id' => (string)$id])
                 );
         }
     }