Fix https://github.com/yiisoft/yii2/issues/2692

https://github.com/yiisoft/yii2/issues/2692