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

Allow fields containing null-safe property paths #6249

Closed
alshenetsky opened this issue Apr 8, 2024 · 1 comment
Closed

Allow fields containing null-safe property paths #6249

alshenetsky opened this issue Apr 8, 2024 · 1 comment
Labels
Milestone

Comments

@alshenetsky
Copy link
Contributor

PropertyAccessor component provides "null-safe property path" feature:
https://symfony.com/doc/current/components/property_access.html#accessing-nullable-property-paths

It would be very useful to have support for this feature to be able to create fields for nested properties, in cases where the object to which the property belongs may be nullable

Example

TextField::new('person?.firstname', 'Firstname')
@javiereguiluz javiereguiluz added this to the 4.x milestone Apr 16, 2024
javiereguiluz added a commit that referenced this issue Apr 16, 2024
…netsky)

This PR was merged into the 4.x branch.

Discussion
----------

Allow fields containing null-safe property paths

see #6249

Added additional field name sanitization so that symfony form does not throw an error on fields with null-safe property paths.

Commits
-------

9d07755 Allow fields containing null-safe property paths
@javiereguiluz
Copy link
Collaborator

Closing as fixed in #6250.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants