From 3440cddf68dc8a61d1b05a255c9e27a475a1c846 Mon Sep 17 00:00:00 2001 From: Bart Vanderstukken Date: Thu, 11 May 2017 17:31:47 +0200 Subject: [PATCH 1/2] fixes #51 --- Form/Type/FileTypeBindSubscriber.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Form/Type/FileTypeBindSubscriber.php b/Form/Type/FileTypeBindSubscriber.php index 5d7b9bb..477d239 100644 --- a/Form/Type/FileTypeBindSubscriber.php +++ b/Form/Type/FileTypeBindSubscriber.php @@ -55,7 +55,14 @@ public function preSet(FormEvent $event) $obj = $form->getParent()->getData(); - if (!$obj) return; + if (!$obj) { + if ($data_class = $form->getParent()->getConfig()->getOption('data_class')) { + $obj = new $data_class(); + } + else { + return; + } + } $mapping = $this->mappingFactory->getMappingFromField($obj, $this->dataStorage->getReflectionClass($obj), From 86beef11467be21612ec7f7550b5bff0de35cb51 Mon Sep 17 00:00:00 2001 From: Bart Vanderstukken Date: Thu, 11 May 2017 21:39:06 +0200 Subject: [PATCH 2/2] updates README --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e4f9a48..d3473c9 100644 --- a/README.md +++ b/README.md @@ -22,11 +22,17 @@ For Russian documentation see http://symfonydev.ru/iphpfilestorebundle/ Add the following lines in your composer.json: ``` -{ "require": { - "iphp/filestore-bundle" : "@stable" - } -} + ... + "iphp/filestore-bundle" : "dev-fix_embedded", + ... + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/sneakyvv/IphpFileStoreBundle.git" + } + ], ``` ### Initialize the bundle