]> 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:50:57 +0000 (09:50 +0100)
galette/lib/Galette/Controllers/Crud/DynamicFieldsController.php
galette/lib/Galette/Core/Picture.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])
                 );
         }
     }
index 53ac7cde7400a7e28112244ed59daf16aa721c68..e19bf67064ff2a577c22a96297f19b378e5fad90 100644 (file)
@@ -289,7 +289,7 @@ class Picture implements FileInterface
     }
 
     /**
-     * Get image file contents
+     * Get image file content
      *
      * @return mixed
      */