From 05a62d4aa0907a5b1b2dfcc350eb903c57c455d2 Mon Sep 17 00:00:00 2001 From: Fafnur Date: Sat, 18 Jun 2016 17:41:45 +0600 Subject: [PATCH] Fixed conflict with sonata admin bundle --- Form/Type/DropzoneType.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Form/Type/DropzoneType.php b/Form/Type/DropzoneType.php index aca9013..e12510d 100644 --- a/Form/Type/DropzoneType.php +++ b/Form/Type/DropzoneType.php @@ -100,8 +100,8 @@ public function buildView(FormView $view, FormInterface $form, array $options) $view->vars['showUploadButton'] = $options['showUploadButton']; $view->vars['uploaderClass'] = $options['uploaderClass']; $view->vars['isShowErrorPopup'] = $options['isShowErrorPopup']; - $view->vars['files'] = $files; - $view->vars['countFiles'] = $files->count(); + $view->vars['files'] = $files ? $files : []; + $view->vars['countFiles'] = $files ? $files->count() : 0; $view->vars['showLabel'] = $options['showLabel']; $view->vars['requestId'] = $options['requestId']; $view->vars['uploadDir'] = $this->mediaHelper->getUploadDirectoryUrl($context);