]> git.agnieray.net Git - galette.git/commitdiff
Fix redirection when dynamic file does not exists
authorJohan Cwiklinski <johan@x-tnd.be>
Sun, 10 Mar 2024 08:50:06 +0000 (09:50 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Sun, 10 Mar 2024 08:51:45 +0000 (09:51 +0100)
galette/lib/Galette/Controllers/Crud/DynamicFieldsController.php
galette/lib/Galette/Core/Picture.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])
                 );
         }
     }
index b0bcaef967dee8854d091c87af59c40cd5505718..8390a21c481fa709f64f50e6e787170031d85748 100644 (file)
@@ -303,7 +303,7 @@ class Picture implements FileInterface
     }
 
     /**
-     * Get image file contents
+     * Get image file content
      *
      * @return mixed
      */