yii2-bootstrap4
yii2-bootstrap4 copied to clipboard
Fixes issue #181
| Q | A |
|---|---|
| Is bugfix? | no |
| New feature? | yes |
| Breaks BC? | yes |
| Tests pass? | yes |
| Fixed issues | #181 |
Yes, @marcovtwout could you refactor it to use the new parent's method?
@bizley PR updated, but I assume tests will fail until yiisoft/yii gets the next stable release.
Yes, not a problem, we will wait. Thank you.
I assume tests will fail until yiisoft/yii gets the next stable release.
Then we need to bump minimal version in composer.json before release.
@marcovtwout possible error: yii\bootstrap4\ToggleButtonGroup::$name is empty when model not set https://github.com/yiisoft/yii2-bootstrap4/blob/37a0cc2f11f6f38b562ab9306eed2f899b72838a/src/ToggleButtonGroup.php#L92 (i checked chain yii\widgets\InputWidget::init() - yii\bootstrap4\ToggleButtonGroup::init()). Current test not cover this case, need test something like this:
public function testCheckboxNoModel()
{
\yii\bootstrap4\Html::$counter = 0;
$html = ToggleButtonGroup::widget([
'type' => ToggleButtonGroup::TYPE_CHECKBOX,
'name' => 'nomodel[value]',
'items' => [
'1' => 'item 1',
'2' => 'item 2',
],
]);
$this->assertContains('...', $html);
}
@WinterSilence I don't think that is correct - all input widgets require either model+attribute or name to be set: https://github.com/yiisoft/yii2/blob/master/framework/widgets/InputWidget.php#L74-L76 - so name should always be available.
@marcovtwout you right, my fail - config loaded before init()
Updated Changelog and composer.json. Note that yii2 2.0.43 is not release yet, I suggest to rerun tests and merge this PR after 2.0.43 is released.
@samdark Could you trigger the build again to see if it now passes? If it passes, it can be merged.
Done. Failed.
@samdark The failed CI is unrelated to this PR, see https://github.com/yiisoft/yii2-bootstrap4/issues/230
👍🏻