Skip to content

Conversation

@enumag
Copy link
Contributor

@enumag enumag commented Dec 15, 2015

I sometimes use boolean parameters in presenters and I want the param=0 part in the URL because FALSE and NULL are totally different values for me. Right now however argsToParams replaces false values with nulls which breaks my use case.

@matej21
Copy link
Contributor

matej21 commented Dec 15, 2015

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, is_scalar($args[$name]) && !is_bool($args[$name]) && (string) $args[$name] === '' can be simplified to $args[$name] === '' :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. Integers and floats should never become an empty string after type casting.

@enumag
Copy link
Contributor Author

enumag commented Jan 13, 2016

@dg Thanks!

@dg
Copy link
Member

dg commented Jan 13, 2016

thanks to you ;)

dg pushed a commit that referenced this pull request Jan 13, 2016
@dg
Copy link
Member

dg commented Jan 13, 2016

The question is whether to include it in v2.3…

@enumag
Copy link
Contributor Author

enumag commented Jan 13, 2016

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.

@dg
Copy link
Member

dg commented Jan 13, 2016

I did not realize that it is a BC break, so it will be in 2.4.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, why did you remove is_scalar here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because as far as I can tell is_scalar($args[$name]) && (string) $args[$name] === '' is equivalent to $args[$name] === '' || $args[$name] === false.

@enumag
Copy link
Contributor Author

enumag commented Jan 13, 2016

Well since it required a change in tests and generates different URLs in some cases I would consider it a BC break...

dg pushed a commit that referenced this pull request Jan 13, 2016
…L and FALSE [Closes #107]

# Conflicts:
#	tests/UI/Presenter.link().php7.phpt
dg pushed a commit that referenced this pull request Jan 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants