From f1427ed6d1448d192fe4690964d0bcfaed9c6a40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laurent=20L=C3=A9cluse?= <laurent.lecluse@unicaen.fr>
Date: Wed, 18 Apr 2018 11:33:07 +0200
Subject: [PATCH] =?UTF-8?q?Correction=20du=20bug=20de=20saisie=20du=20serv?=
 =?UTF-8?q?ice=20r=C3=A9f=C3=A9rentiel?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 CHANGELOG                                            | 12 +++++++++++-
 .../Form/ServiceReferentiel/SaisieFieldset.php       |  8 +++++---
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 8e04a1faa5..9f635a30e1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,8 +1,18 @@
 ---
-title: "Changement intervenus sur OSE"
+title: "Changements intervenus sur OSE"
 author: Laurent Lécluse - DSI - Unicaen
 ...
 
+#OSE 6.3.1 (en développement)
+
+## Corrections de bugs
+
+* Suppression du bug empêchant de saisir des services référentiels si la structure "UNIV" n'existe pas.
+
+
+
+
+
 #OSE 6.3 
 
 ## Corrections de bugs
diff --git a/module/Application/src/Application/Form/ServiceReferentiel/SaisieFieldset.php b/module/Application/src/Application/Form/ServiceReferentiel/SaisieFieldset.php
index aeb24f974b..92614e8ff6 100644
--- a/module/Application/src/Application/Form/ServiceReferentiel/SaisieFieldset.php
+++ b/module/Application/src/Application/Form/ServiceReferentiel/SaisieFieldset.php
@@ -154,9 +154,11 @@ class SaisieFieldset extends AbstractFieldset implements EntityManagerAwareInter
     {
         if (!$this->structures) {
             $qb = $this->getServiceStructure()->finderByEnseignement();
-            $univ = $this->getServiceStructure()->getRacine();
-
-            $this->structures = [$univ->getId() => $univ] + $this->getServiceStructure()->getList($qb);
+            if (!$univ = $this->getServiceStructure()->getRacine()){
+                $this->structures = [$univ->getId() => $univ] + $this->getServiceStructure()->getList($qb);
+            }else{
+                $this->structures = $this->getServiceStructure()->getList($qb);
+            }
         }
 
         return $this->structures;
-- 
GitLab