Skip to content

Conversation

@dakorpar
Copy link
Contributor

@dakorpar dakorpar commented May 8, 2020

  • BC break? no

If setDefaultValue can receive any type then this should be supported in addHidden method as well.
Now it's strange that you cannot do this:

$this->addHidden('count', 0);

but you can do:

$this->addHidden('count')->setDefaultValue(5);

@dg
Copy link
Member

dg commented May 8, 2020

Thanks

@dg dg changed the title Allow any type for addHidden so it works same as setDefaultValue Container::addHidden Allow any type so it works same as setDefaultValue May 8, 2020
@dg dg merged commit bba2500 into nette:master May 8, 2020
@dakorpar dakorpar deleted the patch-1 branch May 8, 2020 17:29
@dakujem
Copy link

dakujem commented Jun 9, 2020

@dakorpar This is a BC Break! It changes the method's signature.

Just try extending the method so that it is compatible with the previous version, then update:

Declaration of ExtendedContainer::addHidden(string $name, ?string $default = NULL): Nette\Forms\Controls\HiddenField should be compatible with Nette\Forms\Container::addHidden(string $name, $default = NULL): Nette\Forms\Controls\HiddenField

Please mark this in the changelog/release notes as such @dg

@dg
Copy link
Member

dg commented Jun 9, 2020

Done

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.

3 participants