8000 Profiler's form page crashes when form types uses nested options · Issue #58665 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Profiler's form page crashes when form types uses nested options #58665

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

Closed
7-zete-7 opened this issue Oct 25, 2024 · 2 comments
Closed

Profiler's form page crashes when form types uses nested options #58665

7-zete-7 opened this issue Oct 25, 2024 · 2 comments

Comments

@7-zete-7
Copy link
Contributor

Symfony version(s) affected

6.4.12

Description

When using nested options with in depth normalisation in a form, the following profiler error occurs:

An exception has been thrown during the rendering of a template ("Notice: Object of class Symfony\Component\VarDumper\Cloner\Data could not be converted to int").

The traceback error occurs in vendor/symfony/web-profiler-bundle/Resources/views/Collector/form.html.twig:651, but I could not find an obvious reason for this error.

How to reproduce

Reproducer: https://github.com/7-zete-7/symfony-form-profiler-reproducer-1

Possible Solution

No response

Additional Context

No response

@vltrof
Copy link
Contributor
vltrof commented Nov 3, 2024

Greetings!
Seems extracting passed/resolved value works incorrect when null/false passed/resolved
So I sent PR where I have tried to fix the problem. Maybe codestyle should be fixed, because of ternary

nicolas-grekas added a commit that referenced this issue Nov 4, 2024
…resolved options are defined (vltrof)

This PR was submitted for the 6.4 branch but it was merged into the 5.4 branch instead.

Discussion
----------

[WebProfilerBoundle] form data collector check passed and resolved options are defined

| Q             | A
| ------------- | ---
| Branch?      | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #58665
| License       | MIT

Greetings!
When passed or resolved value casted to false (null/false) it sets wrong value what cause exceptions described in issue. Explicit check if value defined prevent this behavior
Maybe codestyle should be fixed because of ternary

Commits
-------

93faa96 profiler form data collector extart value property if it is setted
@xabbuh xabbuh closed this as completed Nov 4, 2024
@7-zete-7
Copy link
Contributor Author
7-zete-7 commented Nov 5, 2024

Thanks, @vltrof!

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

No branches or pull requests

5 participants
@xabbuh @7-zete-7 @carsonbot @vltrof and others
0