Skip to content
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

Fix getSetMethodNormalizer to correctly ignore the attributes specified in "ignored_attributes" #30461

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions UPGRADE-4.2.md
Expand Up @@ -179,6 +179,7 @@ FrameworkBundle
* The `Templating\Helper\TranslatorHelper::transChoice()` method has been deprecated, use the `trans()` one instead with a `%count%` parameter.
* Deprecated support for legacy translations directories `src/Resources/translations/` and `src/Resources/<BundleName>/translations/`, use `translations/` instead.
* Support for the legacy directory structure in `translation:update` and `debug:translation` commands has been deprecated.
* The `GetSetMethodNormalizer` class correctly ignores the attributes specified in "ignored_attributes".
nicolas-grekas marked this conversation as resolved.
Show resolved Hide resolved

HttpFoundation
--------------
Expand Down
Expand Up @@ -110,7 +110,7 @@ protected function extractAttributes($object, $format = null, array $context = [

$attributeName = lcfirst(substr($method->name, 0 === strpos($method->name, 'is') ? 2 : 3));

if ($this->isAllowedAttribute($object, $attributeName)) {
if ($this->isAllowedAttribute($object, $attributeName, null, $context)) {
fabpot marked this conversation as resolved.
Show resolved Hide resolved
$attributes[] = $attributeName;
}
}
Expand Down