Skip to content

Navigation Menu

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

Appearance settings

[Serializer] Fix deserializing XML Attributes into string properties #58488

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

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

Hanmac
Copy link
Contributor

@Hanmac Hanmac commented Oct 8, 2024

Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #58479
License MIT

For XML Attributes that are turned into numerics by the XMLEncoder,
but the Property wanted different type (like String), convert them back.

I also added a TestCase

@Hanmac
Copy link
Contributor Author

Hanmac commented Oct 25, 2024

@dunglas can someone take a look at this?

@Hanmac
Copy link
Contributor Author

Hanmac commented Dec 9, 2024

@dunglas what should be done about that AppVeyor?

@OskarStark
Copy link
Contributor

You can rebase, AppVeyor is gone, we moved to GithubActions even for windows tests

@Hanmac
Copy link
Contributor Author

Hanmac commented Dec 9, 2024

Ugh wrong button 😑

Need to rebase manually tomorrow

@Hanmac Hanmac force-pushed the serializerXMLAttributeFloatStringFix branch from 40bf017 to 7825527 Compare December 10, 2024 08:43
@Hanmac
Copy link
Contributor Author

Hanmac commented Dec 10, 2024

Some HttpClient problems, but that shouldn't be related to my PR?

@Hanmac
Copy link
Contributor Author

Hanmac commented Dec 10, 2024

@OskarStark what should I do about the failed Unit Tests? These look unrelated?

@Hanmac Hanmac force-pushed the serializerXMLAttributeFloatStringFix branch from 7825527 to a5ad19e Compare December 12, 2024 12:44
@Hanmac Hanmac force-pushed the serializerXMLAttributeFloatStringFix branch from a5ad19e to 67e2997 Compare February 13, 2025 09:07
@Hanmac
Copy link
Contributor Author

Hanmac commented Feb 13, 2025

Can someone check the failed tests?

XliffFileDumperTest::testEmptyMetadataNotes should be unrelated to this MR
it was #59747 that was faulty

tried to rebase on a previous commit
Rebase worked locally, but i can't trick the Unit Tests there

@Hanmac Hanmac force-pushed the serializerXMLAttributeFloatStringFix branch 2 times, most recently from 9e9007b to 9a7183e Compare February 13, 2025 10:22
@Hanmac
Copy link
Contributor Author

Hanmac commented Feb 13, 2025

@nicolas-grekas there all tests are green too (except the Semaphore)

@nicolas-grekas
Copy link
Member

Thanks for the ping. Looking at the code, I'm wondering if what you want isn't mean to be achieve by using the TYPE_CAST_ATTRIBUTES context option instead of changing anything in the code.

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Feb 13, 2025

Given the discussion in #58479, I think this should be considered as an improvement, so for 7.3
About the implementation, the logic should be moved to the main foreach loop just above, where all similar concerns are located.

@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 7.3 Feb 13, 2025
@Hanmac Hanmac force-pushed the serializerXMLAttributeFloatStringFix branch from 9a7183e to 8032ef8 Compare February 13, 2025 11:48
@Hanmac Hanmac changed the base branch from 6.4 to 7.3 February 13, 2025 11:48
@Hanmac
Copy link
Contributor Author

Hanmac commented Feb 13, 2025

@nicolas-grekas there are some unrelated problems with testCreateTypeContextOrUseProvided

but only for PHP 8.5, i try to pinpoint when it broke

@fabpot fabpot force-pushed the serializerXMLAttributeFloatStringFix branch from 5933418 to 52a3832 Compare February 14, 2025 11:28
@fabpot
Copy link
Member

fabpot commented Feb 14, 2025

Thank you @Hanmac.

@fabpot fabpot merged commit 7cf8df1 into symfony:7.3 Feb 14, 2025
3 of 10 checks passed
@Hanmac Hanmac deleted the serializerXMLAttributeFloatStringFix branch February 14, 2025 11:28
@fabpot fabpot mentioned this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Serializer][XMLEncoder] Fail to Deserialize string attributes when attributes are int/float
5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.