Explorar el Código

Anomalie #814: Err 500 Playlists (delete track)

Bastien Sevajol hace 11 años
padre
commit
13ca6baf15
Se han modificado 1 ficheros con 13 adiciones y 4 borrados
  1. 13 4
      src/Muzich/CoreBundle/Repository/ElementRepository.php

+ 13 - 4
src/Muzich/CoreBundle/Repository/ElementRepository.php Ver fichero

@@ -518,12 +518,21 @@ class ElementRepository extends EntityRepository
518 518
     $doctrineConfig = $this->getEntityManager()->getConfiguration();
519 519
     $doctrineConfig->addCustomStringFunction('FIELD', 'Muzich\CoreBundle\DoctrineExtensions\Query\Mysql\Field');
520 520
     
521
+    if (count($element_ids))
522
+    {
523
+      return $this->getEntityManager()->createQueryBuilder()
524
+        ->select('e, field(e.id, ' . implode(', ', $element_ids) . ') as HIDDEN field')
525
+        ->from('MuzichCoreBundle:Element', 'e')
526
+        ->where('e.id IN (:element_ids)')
527
+        ->setParameter('element_ids', $element_ids)
528
+        ->orderBy('field')
529
+      ;
530
+    }
531
+    
521 532
     return $this->getEntityManager()->createQueryBuilder()
522
-      ->select('e, field(e.id, ' . implode(', ', $element_ids) . ') as HIDDEN field')
533
+      ->select('e')
523 534
       ->from('MuzichCoreBundle:Element', 'e')
524
-      ->where('e.id IN (:element_ids)')
525
-      ->setParameter('element_ids', $element_ids)
526
-      ->orderBy('field')
535
+      ->where('1 = 2')
527 536
     ;
528 537
   }
529 538