File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ private function processEntityAutocompleteFieldTag(ContainerBuilder $container)
47
47
$ wrappedDefinition = (new ChildDefinition ('ux.autocomplete.wrapped_entity_type_autocompleter ' ))
48
48
// the "formType" string
49
49
->replaceArgument (0 , $ serviceDefinition ->getClass ())
50
- ->addTag (self ::ENTITY_AUTOCOMPLETER_TAG , ['alias ' => $ alias ]);
50
+ ->addTag (self ::ENTITY_AUTOCOMPLETER_TAG , ['alias ' => $ alias ])
51
+ ->addTag ('kernel.reset ' , ['method ' => 'reset ' ]);
51
52
$ container ->setDefinition ('ux.autocomplete.wrapped_entity_type_autocompleter. ' .$ alias , $ wrappedDefinition );
52
53
}
53
54
}
Original file line number Diff line number Diff line change 19
19
use Symfony \Component \Form \FormInterface ;
20
20
use Symfony \Component \PropertyAccess \PropertyAccessorInterface ;
21
21
use Symfony \Component \PropertyAccess \PropertyPathInterface ;
22
+ use Symfony \Contracts \Service \ResetInterface ;
22
23
use Symfony \UX \Autocomplete \Doctrine \EntityMetadata ;
23
24
use Symfony \UX \Autocomplete \Doctrine \EntityMetadataFactory ;
24
25
use Symfony \UX \Autocomplete \Doctrine \EntitySearchUtil ;
29
30
*
30
31
* @internal
31
32
*/
32
- final class WrappedEntityTypeAutocompleter implements OptionsAwareEntityAutocompleterInterface
33
+ final class WrappedEntityTypeAutocompleter implements OptionsAwareEntityAutocompleterInterface, ResetInterface
33
34
{
34
35
private ?FormInterface $ form = null ;
35
36
private ?EntityMetadata $ entityMetadata = null ;
@@ -188,4 +189,10 @@ public function setOptions(array $options): void
188
189
189
190
$ this ->options = $ options ;
190
191
}
192
+
193
+ public function reset (): void
194
+ {
195
+ unset($ this ->form );
196
+ $ this ->form = null ;
197
+ }
191
198
}
You can’t perform that action at this time.
0 commit comments