Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Serializer] addcan to the accessor prefixes recognized by theAttributeLoader#61023

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@themasch
Copy link
Contributor

@themaschthemasch commentedJul 2, 2025
edited
Loading

QA
Branch?7.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#61021
LicenseMIT

The ObjectNormalizer already recognizescanX as an accessor and "generates" a property for that, the AttributeLoader does not, so #[Ignore] attributes oncanX are ignored, the return value is encoded in the normalized data.

We just add thecan prefix ot the list of accepted accessor prefixes, so the AttributeLoader now also recognized these.

I adapted a test thatseemd to me to fit the best. If you'd prefer a dedicated test for that, I can do that, too.

@carsonbot

This comment has been minimized.

@carsonbotcarsonbot added this to the7.4 milestoneJul 2, 2025
@carsonbotcarsonbot changed the titlebug #61021: addcan to the accessor prefixes recognized by the AttributeLoader[Serializer] bug #61021: addcan to the accessor prefixes recognized by the AttributeLoaderJul 2, 2025
@OskarStarkOskarStark changed the title[Serializer] bug #61021: addcan to the accessor prefixes recognized by the AttributeLoader[Serializer] addcan to the accessor prefixes recognized by the AttributeLoaderJul 2, 2025
Comment on lines 32 to 36
#[Ignore]
publicfunctiongetSomethingElse():int
{
return42;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This additional test case seems not related to your PR topic. Is there a use for it that I've missed?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I wanted to check the behaviour forgetX and make sure it keeps working after my change.
If you want me to remove it, I can do that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

As it seems already covered bygetIgnored2, I think you can remove it.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ignored2 is itself a property, I wanted to make sure it also works if its just the accessor, without any obvious property backing it. But I'll remove it.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you please add a line to the changelog file of the component?

@themasch
Copy link
ContributorAuthor

@nicolas-grekas like this?

@themaschthemaschforce-pushed theserializer-ignore-caner branch 2 times, most recently from2003146 to2d7a3fbCompareJuly 7, 2025 07:29
@themasch
Copy link
ContributorAuthor

Would it make sense to backport this to 7.3, 7.2 and 6.4, or would that be to big of a BC break?

@stof
Copy link
Member

stof commentedJul 7, 2025

New features are never backported in patch versions.

@themasch
Copy link
ContributorAuthor

Okay, so this counts as a new feature, not a bug fix? Good to know, so we'll need to wait for 7.4 to remove our work around! Thanks!

@OskarStarkOskarStark changed the title[Serializer] addcan to the accessor prefixes recognized by the AttributeLoader[Serializer] addcan to the accessor prefixes recognized by theAttributeLoaderJul 7, 2025
@nicolas-grekas
Copy link
Member

Thank you@themasch.

@nicolas-grekasnicolas-grekas merged commitcabe552 intosymfony:7.4Jul 15, 2025
3 of 11 checks passed
This was referencedOct 27, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@welcoMatticwelcoMatticwelcoMattic left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@mtarldmtarldmtarld approved these changes

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

7.4

Development

Successfully merging this pull request may close these issues.

[Serializer] ObjectNormalizer recognizescanX as getter, but Attribute loader does not

7 participants

@themasch@carsonbot@stof@nicolas-grekas@welcoMattic@mtarld@OskarStark

[8]ページ先頭

©2009-2025 Movatter.jp