]> git.agnieray.net Git - galette.git/commitdiff
Various fixes
authorJohan Cwiklinski <johan@x-tnd.be>
Wed, 17 Nov 2021 05:59:39 +0000 (06:59 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Wed, 17 Nov 2021 06:00:14 +0000 (07:00 +0100)
galette/includes/dependencies.php
galette/lib/Galette/Controllers/Crud/MembersController.php
galette/lib/Galette/Entity/Adherent.php
galette/templates/default/editer_champ.tpl
galette/templates/default/traduire_libelles.tpl

index c1e86bebb0d94ed55a41ddee1d0dbdadac5b2bd0..845993692e76f17c6f674a2da58de94405ae4a74 100644 (file)
@@ -471,6 +471,7 @@ if (
     $hist = $container->get('history');
     $l10n = $container->get('l10n');
     $emitter = $container->get('event_manager');
+    $router = $container->get('router');
 }
 $i18n = $container->get('i18n');
 $translator = $container->get('translator');
index 74355e1c1ce84b0bd3c1f4d980956722dbdba0a5..0639530c6b56f0584b0f98d488217818c21f3e21 100644 (file)
@@ -1067,7 +1067,6 @@ class MembersController extends CrudController
     ): Response {
         //instantiate member object
         $member = new Adherent($this->zdb);
-        $member->enableAllDeps()->load($id);
 
         if ($this->session->member !== null) {
             //retrieve from session, in add or edit
@@ -1075,6 +1074,7 @@ class MembersController extends CrudController
             $this->session->member = null;
             $id = $member->id;
         }
+        $member->enableAllDeps();
 
         if ($id !== null) {
             //load requested member
index 34a70a53e0e0499f0d24e75773e34e2b05b4cfec..c3853cfbe041fb96542ba7077494fb4d6df1235b 100644 (file)
@@ -1828,7 +1828,7 @@ class Adherent
             $email = $this->parent->email;
         }
 
-        return $email;
+        return $email ?? '';
     }
 
     /**
@@ -1845,7 +1845,7 @@ class Adherent
             $address = $this->parent->address;
         }
 
-        return $address;
+        return $address ?? '';
     }
 
     /**
@@ -1863,7 +1863,7 @@ class Adherent
             $address_continuation = $this->parent->address_continuation;
         }
 
-        return $address_continuation;
+        return $address_continuation ?? '';
     }
 
     /**
@@ -1881,7 +1881,7 @@ class Adherent
             $zip = $this->parent->zipcode;
         }
 
-        return $zip;
+        return $zip ?? '';
     }
 
     /**
@@ -1899,7 +1899,7 @@ class Adherent
             $town = $this->parent->town;
         }
 
-        return $town;
+        return $town ?? '';
     }
 
     /**
@@ -1917,7 +1917,7 @@ class Adherent
             $country = $this->parent->country;
         }
 
-        return $country;
+        return $country ?? '';
     }
 
     /**
index 65b2a6c70057893699ec8f0652fb255c599f727b..5499762bb37dbd40f6e744e7d1bc7397f55d8a16 100644 (file)
                     {_T string="Add"}
                 </button>
                 <input type="hidden" name="form_name" id="form_name" value="{$form_name}"/>
+                {include file="forms_types/csrf.tpl"}
             </div>
     {if $mode neq 'ajax'}
         </fieldset>
index ee8e89dfc6b774284cb2e28c85fc7571261c4761..138fdce366c9cb88fa3a057be6e63f44c2f1fdcf 100644 (file)
@@ -47,6 +47,7 @@
 {/block}
 
 {block name="javascripts"}
+{if isset($trans) && $trans|@count > 0}
     {if $exists}
     <script type="text/javascript">
         $('#text_orig').change(function(e) {
@@ -58,4 +59,5 @@
         });
     </script>
     {/if}
+{/if}
 {/block}