-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
setCircularReferenceHandler() is deprecated #30998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@dhaarbrink the argument $defaultContext = [
'circular_reference_handler' => new CircularReferenceHandler(),
];
$normalizer = new GetSetMethodNormalizer(null, null, null, null, null, $defaultContext);
...
$customContext = [
'circular_reference_handler' => new MyCustomCircularReferenceHandler(),
];
$normalizer->denormalize($data, $class, $format, $customContext); |
Well, according to the docs, you should use And then there's the 'circular_reference_handler' config option in the FrameworkBundle, which is passed to the |
We need to update the docs and fix the code. |
This PR was merged into the 4.2 branch. Discussion ---------- Update serializer.rst shows the new way to define a `circular_reference_handler` on the normalizer symfony/symfony#30998 Commits ------- d562333 Update serializer.rst
Okay, so the docs are fixed. Thanks for that @javiereguiluz! Now I think there is one bug left: calling |
…aarbrink) This PR was squashed before being merged into the 4.3-dev branch (closes #31073). Discussion ---------- #30998 Fix deprecated setCircularReferenceHandler call | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30998 | License | MIT Instead of calling the `setCircularReferenceHandler()` method, it puts the handler in the default context. Commits ------- 3a68040 #30998 Fix deprecated setCircularReferenceHandler call
…ulnet) This PR was merged into the 4.2 branch. Discussion ---------- [FrameworkBundle] fix math depth handler configuration | Q | A | ------------- | --- | Branch? | 4.2 f | Bug fix? | no "fix deprecated" | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30998 | License | MIT | Doc PR | fix serializer configuration max_deep_handler Commits ------- fb9fc80 fix math depth handler
…ulnet) This PR was merged into the 4.2 branch. Discussion ---------- [FrameworkBundle] fix math depth handler configuration | Q | A | ------------- | --- | Branch? | 4.2 f | Bug fix? | no "fix deprecated" | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#30998 | License | MIT | Doc PR | fix serializer configuration max_deep_handler Commits ------- fb9fc804d3 fix math depth handler
Symfony version(s) affected: 4.2.5
Description
When I enable a circular reference handler in my framework.yaml, I get a deprecation warning in my logs
How to reproduce
Enable a circular reference handler in your framework.yaml:
Possible Solution
The FrameworkExtension reads the config, and calls
setCircularReferenceHandler()
onAbstractNormalizer
, but instead it should set it as a default context.Additional context
The text was updated successfully, but these errors were encountered: