-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'InvalidArgumentException' in Postgres Array's #15804
Comments
I think you need to change default value to [['s_all', 's_uch',], 'each', 'rule' => ['default', 'value' => []] ], |
No effect. Same error. Also, when we make [['s_all', 's_uch',], 'safe'], we got another error SQLSTATE[22P02]: Invalid text representation: 7 Error: ivalid value for integer: "" Maybe we need some flag in config like |
Enhm... yes, I was wrong. Need to check in details |
@SilverFire I suppose it requires to check if value is |
@torchinsky Thank you for the report. Could you check whether your problem is fixed in @Tigrov yes, it was related to |
@SilverFire you did a great job to implement support of |
@SilverFire by the way, I think it's better to check if value is yii2/framework/db/pgsql/ColumnSchema.php Line 59 in d5d4b8b
To avoid any Expressions for |
First of all - sorry for my english...
What steps will reproduce the problem?
[['s_all', 's_uch',], 'each', 'rule' => ['default', 'value' => null] ],
What is the expected result?
On update expected saving data to s_all
What do you get instead?
exception 'InvalidArgumentException' with message 'Passed variable is not an array or object, using empty array instead' in /mnt/disk/www/realty/vendor/yiisoft/yii2/db/ArrayExpression.php:189
Stack trace:
#0 /mnt/disk/www/realty/vendor/yiisoft/yii2/db/ArrayExpression.php(189): ArrayIterator->__construct(NULL)
#1 /mnt/disk/www/realty/vendor/yiisoft/yii2/validators/EachValidator.php(141): yii\db\ArrayExpression->getIterator()
#2 /mnt/disk/www/realty/vendor/yiisoft/yii2/validators/Validator.php(267): yii\validators\EachValidator->validateAttribute(Object(app\modules\realty\models\RealtyBuyers), 's_uch')
#3 /mnt/disk/www/realty/vendor/yiisoft/yii2/base/Model.php(367): yii\validators\Validator->validateAttributes(Object(app\modules\realty\models\RealtyBuyers), Array)
#4 /mnt/disk/www/realty/vendor/yiisoft/yii2/widgets/ActiveForm.php(418): yii\base\Model->validate(NULL)
#5 /mnt/disk/www/realty/modules/realty/controllers/BuyersController.php(197): yii\widgets\ActiveForm::validate(Object(app\modules\realty\models\RealtyBuyers))
#6 [internal function]: app\modules\realty\controllers\BuyersController->actionUpdate('3383')
#7 /mnt/disk/www/realty/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#8 /mnt/disk/www/realty/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#9 /mnt/disk/www/realty/vendor/yiisoft/yii2/base/Module.php(528): yii\base\Controller->runAction('update', Array)
#10 /mnt/disk/www/realty/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction('realty/buyers/u...', Array)
#11 /mnt/disk/www/realty/vendor/yiisoft/yii2/base/Application.php(386): yii\web\Application->handleRequest(Object(yii\web\Request))
#12 /mnt/disk/www/realty/web/index.php(24): yii\base\Application->run()
#13 {main}
But if we make in view
it will works fine.
Additional info
The text was updated successfully, but these errors were encountered: