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

DefaultFormRenderer: Fix GET Application\UI\Form #222

Merged
merged 1 commit into from Jul 4, 2019

Conversation

@jtojnar
Copy link
Contributor

jtojnar commented May 10, 2019

Forms\Form allows to pass stringable objects to setAction method, which is also used by Application\UI\Form to store Application\UI\Link object. DefaultFormRenderer calls string manipulation functions on the Form’s action when rendering, causing it to raise a TypeError when strict types are enabled.

To fix this, I am stringifying the action in the DefaultFormRenderer. I have opted to do it there, rather than in the Form::setAction method, in case the Link object is not ready yet at the time the Form is created.

Closes: nette/application#218

Forms\Form allows to pass stringable objects to setAction method,
which is also used by Application\UI\Form to store Application\UI\Link object.
DefaultFormRenderer calls string manipulation functions on the Form’s action
when rendering, causing it to raise a TypeError when strict types are enabled.

To fix this, I am stringifying the action in the DefaultFormRenderer.
I have opted to do it there, rather than in the Form::setAction method,
in case the Link object is not ready yet at the time the Form is created.
@dg

This comment has been minimized.

Copy link
Member

dg commented Jul 4, 2019

Thanks!

@dg dg merged commit b3356d0 into nette:master Jul 4, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.003%) to 95.071%
Details
dg added a commit that referenced this pull request Jul 8, 2019
Forms\Form allows to pass stringable objects to setAction method,
which is also used by Application\UI\Form to store Application\UI\Link object.
DefaultFormRenderer calls string manipulation functions on the Form’s action
when rendering, causing it to raise a TypeError when strict types are enabled.

To fix this, I am stringifying the action in the DefaultFormRenderer.
I have opted to do it there, rather than in the Form::setAction method,
in case the Link object is not ready yet at the time the Form is created.
@jtojnar jtojnar deleted the jtojnar:object-action branch Jul 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.