-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Make it more clear that form names need to be unique #4960
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
Comments
Do you really think that this is a documentation problem? I think that obscure problems like this should be reported using an exception thrown by the Form component. |
I don't think it's trivial to solve in the code (ping @webmozart). I agree it's not really user friendly at the moment. However, even if we solved it in the code, this is an important detail, which should be highlighted in the docs in my opinion. |
It's already highlighted: "should return a unique identifier" I don't think we can solve it better. Instead, I agree with @javiereguiluz, the code should have some validation for it to also help people who don't read the docs. |
@wouterj it's not highlighted. It doesn't stand out visually ;) I agree we should do it in code too, but fixing docs is a quick win. |
👍 i notice beginners like make many types that have same names. More than that, they name them like symfony types. |
@wouterj allowing to overwrite a form type by registering a type again with this name is actually a feature. |
…plication (javiereguiluz) This PR was merged into the 2.3 branch. Discussion ---------- Better explain that form types should be unique in the application | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | #4960 Commits ------- 7a78532 Fixed a minor grammar issue 0eb149b Recommend app_ instead of app. as form type prefix 52a5551 Recommend a better way to standardize application form types d47e751 Fixed syntax issues and provided more information 12b77af Better explain that form types should be unique in the application
Closing as #5076 added a caution, which is the most clear way of warning the user in the docs. |
Currently, the docs say:
I propose it's made more visible the name should be unique. It's no where verified, and might lead to unexpected problems (like symfony/symfony#13590).
The text was updated successfully, but these errors were encountered: