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

46867 - add more helpful property path accessor exceptions #50128

Conversation

patrickmaynard
Copy link
Contributor

@patrickmaynard patrickmaynard commented Apr 23, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? no
Deprecations? no
Tickets #46867
License MIT
Doc PR none

Dear reviewers,

This small modification adds more helpful exceptions when properties cannot be accessed/set
using forms. Only one file was modified, so it should be relatively easy to review. Please feel free to leave a comment if you have any questions about what I'm doing here, and thanks for your work as a reviewer on an open-source project!

All the best,

Patrick

@patrickmaynard
Copy link
Contributor Author

patrickmaynard commented Apr 23, 2023

All tests seem to be passing, but there's some sort of infrastructure error when the pipeline runs:

Error: KO src/Symfony/Component/Mime

Any ideas on what this means? It seems to be unrelated to the change in my PR.

@nicolas-grekas nicolas-grekas modified the milestones: 6.3, 6.4 May 23, 2023
@patrickmaynard
Copy link
Contributor Author

patrickmaynard commented Aug 2, 2023

All tests seem to be passing, but there's some sort of infrastructure error when the pipeline runs:

Error: KO src/Symfony/Component/Mime

Any ideas on what this means? It seems to be unrelated to the change in my PR.

@nicolas-grekas @aurelijus @theinterned @alexislefebvre @OskarStark @xabbuh anybody have thoughts on what I should do next to try to get the pipeline running correctly again? As I mentioned, this broken pipeline doesn't seem to have anything to do with my (very small) changes, which I would really like to merge soon.

@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 7.1 Nov 15, 2023
try {
$this->propertyAccessor->setValue($data, $propertyPath, $value);
} catch (NoSuchPropertyException $e) {
throw new NoSuchPropertyException($e->getMessage().' Make the property public, add a setter, or set the "mapped" field option in the form type to be false.');
Copy link
Member

Choose a reason for hiding this comment

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

Can we set $e as the previous exception instead or concatenating the messages?

@fabpot fabpot force-pushed the 46867-better-property-path-accessor-exceptions branch from b63c15b to 8d87a67 Compare March 17, 2024 16:57
@fabpot
Copy link
Member

fabpot commented Mar 17, 2024

Thank you @patrickmaynard.

@fabpot fabpot merged commit 8574147 into symfony:7.1 Mar 17, 2024
7 of 10 checks passed
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.

None yet

4 participants