File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -217,21 +217,9 @@ public function postSubmit(FormEvent $event)
217217 {
218218 $ form = $ event ->getForm ();
219219 $ data = $ form ->getParent ()->getData ();
220-
221- $ current = $ form ;
222- $ isAllValid = true ;
223-
224- // check recuresively this form and all it's parents
225- do {
226- if (!$ current ->isValid ()) {
227- $ isAllValid = false ;
228- break ;
229- }
230- $ current = $ current ->getParent ();
231- } while (null !== $ current );
232-
220+
233221 $ getter = 'get ' .ucfirst ($ this ->propertyName );
234- if (!$ isAllValid && $ data ->$ getter () instanceof ArrayCollection) {
222+ if (!$ form -> isValid () && $ data ->$ getter () instanceof ArrayCollection) {
235223 // remove files absent in the original collection
236224 $ data ->$ getter ()->clear ();
237225
You can’t perform that action at this time.
0 commit comments