Browse Source

bug fix a partir des tests

bastien 12 years ago
parent
commit
e2bbd50dd6

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

@@ -111,10 +111,13 @@ class CoreController extends Controller
111 111
     // Si il existe déjà c'est qu'il ne veut plus suivre
112 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 122
       $em->remove($Follow);
120 123
       $em->flush();

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

@@ -87,4 +87,14 @@ class FollowGroup
87 87
   {
88 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,6 +57,7 @@ class HomeControllerTest extends FunctionalTest
57 57
         'group_id'  => null,
58 58
         'favorite' => false,
59 59
         'ids'       => null,
60
+        'ids_display' => null
60 61
     ), $this->getSession()->get('user.element_search.params'));
61 62
     
62 63
     // On fabrique l'ElementSearcher correspondant

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

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