Closed serge1978 closed 1 year ago
What is the exact error message?
@serge1978 Please try: #7691
As a workaround:
setValidationRules()
What is the exact error message?
"message": "Cannot access offset of type string on string",
"file": ".../vendor/codeigniter4/framework/system/BaseModel.php",
@kenjis , thanks!
@kenjis, oh, forgot to ask... Is this behavior currently a bug or a feature? Will setValidationRule() method work with ruleGroup in future release?
PHP Version
8.2
CodeIgniter4 Version
4.3.6
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
Linux
Which server did you use?
fpm-fcgi
Database
MySQL 8.0.28
What happened?
Model::setValidationRule() method doesn't work and leads to error for me:
Link for method in user guide: https://codeigniter.com/user_guide/models/model.html?highlight=setvalidationrule#CodeIgniter\Model::setValidationRule
Steps to Reproduce
I'm trying to use Model::setValidationRule() method inside of model. For example:
Expected Output
As I understood from the user guide I expected to override validation rules for the specified field dynamically, declared earlier in $validationRules property...
Anything else?
No response