]> 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 3b6f97be43aef592632985e539a59bc2b14ce713..56462f04293c749a980ee20da3180e50060e7bdb 100644 (file)
@@ -364,10 +364,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' => (string)$id])
+                    $this->routeparser->urlFor($route_name, ['id' => (string)$id])
                 );
         }
     }