title: Symfony2 KnpPaginator bundle, cannot do sorting with 2 paginated tables in my view
body: <p>I have 1 controller that passes 2 paginated set of results to a twig (as 2 arrays representing tables) using KnpPaginator Bundle.</p>
  
  <p>While both tables show up and are paginated, I am not able to sort any of them.
  <strong>Edit:</strong> When I change page of table 1, table 2's page also changes to that page number.</p>
  
  <p>Trying to sort either of them returns: There is no component aliased by [t] in the given Query or There is no component aliased by [r] in the given Query.</p>
  
  <p>The controller:</p>
  
  <pre><code>    $em = $this-&gt;getDoctrine()-&gt;getEntityManager();
      $pageSize =  $this-&gt;container-&gt;getParameter('page_size');
      $paginator = $this-&gt;get('knp_paginator');
  
      /* Queries */
      $queryTest = $em
          -&gt;createQuery('
              SELECT t FROM PanasonicTestEtAvisBundle:Test t
              JOIN t.product p
              WHERE p.id = :id
              AND t.isDeleted = :isdeleted
              ORDER BY t.creationDate DESC'
          )-&gt;setParameter('id', $id)
           -&gt;setParameter('isdeleted', '0');
  
      $queryReview = $em
          -&gt;createQuery('
              SELECT r FROM PanasonicTestEtAvisBundle:Review r
              JOIN r.product p 
              WHERE p.id = :id
              AND r.isDeleted = :isdeleted
              ORDER BY r.creationDate DESC'
          )-&gt;setParameter('id', $id)
           -&gt;setParameter('isdeleted', '0');
  
      /* paginated results */
      $paginationTest = $paginator-&gt;paginate($queryTest, $this-&gt;get('request')-&gt;query-&gt;get('page', 1), $pageSize);
  //        compact('paginationTest');
  
      $paginationReview = $paginator-&gt;paginate($queryReview, $this-&gt;get('request')-&gt;query-&gt;get('page', 1), $pageSize);
  //        compact('paginationReview');
  //        compact('pagination');
  
      return $this-&gt;render('PanasonicTestEtAvisBundle:Product:show.html.twig', array(
          'paginationTest' =&gt; $paginationTest,
          'paginationReview' =&gt; $paginationReview
      ));
  </code></pre>
  
  <p><strong>The error shows up only when I pass both pagination (paginationTest &amp; paginationReview), if I pass only one it works flawlessly.</strong></p>
  
  <p>Anyone can tell me how I can solve this problem?</p>