Browse Source

bug fix a partir des tests

bastien 13 years ago
parent
commit
e2bbd50dd6

+ 7 - 4
src/Muzich/CoreBundle/Controller/CoreController.php View File

111
     // Si il existe déjà c'est qu'il ne veut plus suivre
111
     // Si il existe déjà c'est qu'il ne veut plus suivre
112
     if ($Follow)
112
     if ($Follow)
113
     {
113
     {
114
-      // L'utilisateur suis déjà, on doit détruire l'entité
115
-      $event = new EventUser($this->container);
116
-      $event->removeFromFollow($Follow->getFollowed());
117
-      $em->persist($Follow->getFollowed());
114
+      if ($type == 'user')
115
+      {
116
+        // L'utilisateur suis déjà, on doit détruire l'entité
117
+        $event = new EventUser($this->container);
118
+        $event->removeFromFollow($Follow->getFollowed());
119
+        $em->persist($Follow->getFollowed());
120
+      }
118
       
121
       
119
       $em->remove($Follow);
122
       $em->remove($Follow);
120
       $em->flush();
123
       $em->flush();

+ 10 - 0
src/Muzich/CoreBundle/Entity/FollowGroup.php View File

87
   {
87
   {
88
     return $this->group;
88
     return $this->group;
89
   }
89
   }
90
+  
91
+  /**
92
+   * Retourne le groupe suivis
93
+   * 
94
+   * @return Group 
95
+   */
96
+  public function getFollowed()
97
+  {
98
+    return $this->group;
99
+  }
90
 }
100
 }

+ 1 - 0
src/Muzich/CoreBundle/Tests/Controller/HomeControllerTest.php View File

57
         'group_id'  => null,
57
         'group_id'  => null,
58
         'favorite' => false,
58
         'favorite' => false,
59
         'ids'       => null,
59
         'ids'       => null,
60
+        'ids_display' => null
60
     ), $this->getSession()->get('user.element_search.params'));
61
     ), $this->getSession()->get('user.element_search.params'));
61
     
62
     
62
     // On fabrique l'ElementSearcher correspondant
63
     // On fabrique l'ElementSearcher correspondant

+ 2 - 0
src/Muzich/MynetworkBundle/Resources/config/routing.yml View File

2
 mynetwork_index:
2
 mynetwork_index:
3
   pattern:  /my-network/{event_id}
3
   pattern:  /my-network/{event_id}
4
   defaults: { _controller: MuzichMynetworkBundle:Mynetwork:index, event_id: null }
4
   defaults: { _controller: MuzichMynetworkBundle:Mynetwork:index, event_id: null }
5
+  requirements:
6
+    event_id:  \d+
5
   
7
   
6
 mynetwork_search:
8
 mynetwork_search:
7
   pattern:  /my-network/search
9
   pattern:  /my-network/search