Fix Presenter::argsToParams to not remove false#107
Fix Presenter::argsToParams to not remove false#107enumag wants to merge 1 commit intonette:masterfrom
Conversation
|
👍 |
src/Application/UI/Presenter.php
Outdated
There was a problem hiding this comment.
I think, is_scalar($args[$name]) && !is_bool($args[$name]) && (string) $args[$name] === '' can be simplified to $args[$name] === '' :)
There was a problem hiding this comment.
Probably. Integers and floats should never become an empty string after type casting.
|
@dg Thanks! |
|
thanks to you ;) |
|
The question is whether to include it in v2.3… |
|
It admitedly is a BC break so as much as I'd like it in stable 2.x, putting it in 2.3 is probably not a best idea. Are there other commits like this? If so we might want to release nette/application 2.4. |
|
I did not realize that it is a BC break, so it will be in 2.4. |
There was a problem hiding this comment.
Just wondering, why did you remove is_scalar here?
There was a problem hiding this comment.
Because as far as I can tell is_scalar($args[$name]) && (string) $args[$name] === '' is equivalent to $args[$name] === '' || $args[$name] === false.
|
Well since it required a change in tests and generates different URLs in some cases I would consider it a BC break... |
…L and FALSE [Closes #107] # Conflicts: # tests/UI/Presenter.link().php7.phpt
I sometimes use boolean parameters in presenters and I want the
param=0part in the URL becauseFALSEandNULLare totally different values for me. Right now however argsToParams replaces false values with nulls which breaks my use case.