|
@@ -565,16 +565,20 @@ class ElementController extends Controller
|
565
|
565
|
$values = $this->getRequest()->request->get('element_tag_proposition_'.$element->getId());
|
566
|
566
|
$tags_ids = json_decode($values['tags'], true);
|
567
|
567
|
|
568
|
|
- // On récupère les tags en base
|
569
|
|
- $tags = $this->getDoctrine()->getEntityManager()->getRepository('MuzichCoreBundle:Tag')
|
570
|
|
- ->getTagsWithIds($tags_ids)
|
571
|
|
- ;
|
|
568
|
+ $tags = array();
|
|
569
|
+ if (count($tags_ids))
|
|
570
|
+ {
|
|
571
|
+ // On récupère les tags en base
|
|
572
|
+ $tags = $this->getDoctrine()->getEntityManager()->getRepository('MuzichCoreBundle:Tag')
|
|
573
|
+ ->getTagsWithIds($tags_ids)
|
|
574
|
+ ;
|
|
575
|
+ }
|
572
|
576
|
|
573
|
577
|
if (!count($tags))
|
574
|
578
|
{
|
575
|
579
|
return $this->jsonResponse(array(
|
576
|
580
|
'status' => 'error',
|
577
|
|
- 'errors' => array('NotFound')
|
|
581
|
+ 'errors' => array($this->trans('element.tag_proposition.form.error.empty', array(), 'elements'))
|
578
|
582
|
));
|
579
|
583
|
}
|
580
|
584
|
|