]> git.agnieray.net Git - galette.git/blobdiff - galette/lib/Galette/Entity/Adherent.php
Use selectize to attach members
[galette.git] / galette / lib / Galette / Entity / Adherent.php
index 4afaa1db27c0a4c4bd53691fbc53c72c8a6a8a25..ee73648c9da906e2d1e06a06582a7a4a61ece057 100644 (file)
@@ -958,6 +958,14 @@ class Adherent
             $values['societe_adh'] = '';
         }
 
+        //no parent if checkbox was unchecked
+        if (!isset($values['attach'])
+            && empty($this->_id)
+            && isset($values['parent_id'])
+        ) {
+            unset($values['parent_id']);
+        }
+
         foreach ($fields as $key) {
             //first of all, let's sanitize values
             $key = strtolower($key);