Explorar el Código

fix 'organization not set' bug

Olivier Massot hace 8 meses
padre
commit
759abd4be6
Se han modificado 1 ficheros con 3 adiciones y 5 borrados
  1. 3 5
      src/Entity/Organization/Organization.php

+ 3 - 5
src/Entity/Organization/Organization.php

@@ -527,12 +527,10 @@ class Organization
 
     public function setSettings(Settings $settings): self
     {
-        // set the owning side of the relation if necessary
-        if ($settings->getOrganization() !== $this) {
-            $settings->setOrganization($this);
-        }
-
         $this->settings = $settings;
+        
+        // set the owning side of the relation
+        $settings->setOrganization($this);
 
         return $this;
     }