8000 bug #31071 property normalizer should also pass format and context to… · rvanlaak/symfony@2a1137a · GitHub
[go: up one dir, main page]

Skip to content

Commit 2a1137a

Browse files
bug symfony#31071 property normalizer should also pass format and context to isAllowedAttribute (dbu)
This PR was merged into the 3.4 branch. Discussion ---------- property normalizer should also pass format and context to isAllowedAttribute | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | found while working on symfony#30888 | License | MIT | Doc PR | - the context and format are optional parameters to `isAllowedAttribute`, but should be forwarded. due to this omission, the PropertyNormalizer was ignoring the 'attributes' context option (and does in version 4 also ignore the 'ignore_attributes' context option - that one is a property on the normalizer class in version 3 and therefore not ignored here) Commits ------- 13e2fb7 property normalizer should also pass format and context to isAllowedAttribute
2 parents bd28ac6 + 13e2fb7 commit 2a1137a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected function extractAttributes($object, $format = null, array $context = [
102102

103103
do {
104104
foreach ($reflectionObject->getProperties() as $property) {
105-
if (!$this->isAllowedAttribute($reflectionObject->getName(), $property->name)) {
105+
if (!$this->isAllowedAttribute($reflectionObject->getName(), $property->name, $format, $context)) {
106106
continue;
107107
}
108108

0 commit comments

Comments
 (0)
0