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 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
Copy link
Member

@dg dg commented Jul 4, 2019

Thanks!

@dg dg merged commit b3356d0 into nette:master Jul 4, 2019
2 checks passed
dg pushed a commit that referenced this issue 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 object-action branch Jul 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants