]> git.agnieray.net Git - galette.git/commitdiff
Fix redirection when an error occurs adding a child
authorJohan Cwiklinski <johan@x-tnd.be>
Sat, 16 Oct 2021 06:30:11 +0000 (08:30 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Sun, 17 Oct 2021 04:15:40 +0000 (06:15 +0200)
galette/lib/Galette/Controllers/Crud/MembersController.php
galette/lib/Galette/Entity/Adherent.php
galette/templates/default/member.tpl

index ed75e789d2f475d5909c9a89e6d434c5628ee9f2..504698507cff88e176c6a1aab1fde9e66fb018fd 100644 (file)
@@ -1768,7 +1768,7 @@ class MembersController extends CrudController
                             ['id'    => $member->id]
                         );
                     } else {
-                        $redirect_url = $this->router->pathFor('addMember');
+                        $redirect_url = $this->router->pathFor((isset($post['addchild']) ? 'addMemberChild' : 'addMember'));
                     }
                 }
             }
index 9fc2d2bad5d1950ed53178f1d5f0e042a6747ec7..a6c67f1438771e516b30846a8ec58c40f5e061d7 100644 (file)
@@ -1096,6 +1096,9 @@ class Adherent
                         //values that are set at object instantiation
                         $value = $this->$prop;
                         break;
+                    case self::PK:
+                        $value = null;
+                        break;
                     default:
                         $value = '';
                         break;
index 71cac9bf77c72d8e4ad7288d478b2752ed2379f1..0e0cefd5fc07d97b7d0be04ea522e60beffa1a5d 100644 (file)
@@ -69,6 +69,9 @@
         {else}
             <input type="hidden" name="redirect_on_create" value="{constant('Galette\Entity\Adherent::AFTER_ADD_SHOW')}"/>
         {/if}
+        {if isset($addchild) && $addchild}
+            <input type="hidden" name="addchild" value="true"/>
+        {/if}
     {/if}
 
     {if $pref_mail_method neq constant('Galette\Core\GaletteMail::METHOD_DISABLED') and (!$self_adh and ($login->isAdmin() or $login->isStaff()))}