Closed Dorkdomain closed 3 months ago
What do you have in your model validation rules? I'm interested in "filter".
您的模型验证规则中有什么?我对“过滤器”感兴趣。
[$this->attributes(), 'trim'],
That's the only rule. All the other rules are [safe]
Please referring to this link, https://github.com/yiisoft/yii2-gii/commit/c9efc088cd7003353125b2a2cc696d4b1028eafc ,I think they are the same bug。 I have tried to modify the local source code according to this code, and it is already running correctly。
Thanks for reporting. Do you have time for a pull request?
Thanks for reporting. Do you have time for a pull request?
I haven't done pull requests before, I tried my best and hope to help.
What steps will reproduce the problem?
Using mongo-gii, try to Preview a MongoModel.
What's expected?
Correct execution
What do you get instead?
PHP Deprecated Warning 'yii\base\ErrorException' with message 'trim(): Passing null to parameter #1 ($string) of type string is deprecated'
in /vendor/yiisoft/yii2/validators/FilterValidator.php:81
PHP Deprecated Warning 'yii\base\ErrorException' with message 'strtolower(): Passing null to parameter #1 ($string) of type string is deprecated'
in /vendor/yiisoft/yii2-gii/src/Generator.php:499
Additional info
gii used to have the same error,url :https://github.com/yiisoft/yii2-gii/issues/505 But mongo-gii was forgotten to fix the bug