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)
4747 $ wrappedDefinition = (new ChildDefinition ('ux.autocomplete.wrapped_entity_type_autocompleter ' ))
4848 // the "formType" string
4949 ->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 ' ]);
5152 $ container ->setDefinition ('ux.autocomplete.wrapped_entity_type_autocompleter. ' .$ alias , $ wrappedDefinition );
5253 }
5354 }
Original file line number Diff line number Diff line change 1919use Symfony \Component \Form \FormInterface ;
2020use Symfony \Component \PropertyAccess \PropertyAccessorInterface ;
2121use Symfony \Component \PropertyAccess \PropertyPathInterface ;
22+ use Symfony \Contracts \Service \ResetInterface ;
2223use Symfony \UX \Autocomplete \Doctrine \EntityMetadata ;
2324use Symfony \UX \Autocomplete \Doctrine \EntityMetadataFactory ;
2425use Symfony \UX \Autocomplete \Doctrine \EntitySearchUtil ;
2930 *
3031 * @internal
3132 */
32- final class WrappedEntityTypeAutocompleter implements OptionsAwareEntityAutocompleterInterface
33+ final class WrappedEntityTypeAutocompleter implements OptionsAwareEntityAutocompleterInterface, ResetInterface
3334{
3435 private ?FormInterface $ form = null ;
3536 private ?EntityMetadata $ entityMetadata = null ;
@@ -188,4 +189,10 @@ public function setOptions(array $options): void
188189
189190 $ this ->options = $ options ;
190191 }
192+
193+ public function reset (): void
194+ {
195+ unset($ this ->form );
196+ $ this ->form = null ;
197+ }
191198}
You can’t perform that action at this time.
0 commit comments