File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public function run()
56
56
$ class = $ this ->modelClass ;
57
57
$ pk = Yii::$ app ->request ->post ('pk ' );
58
58
$ attribute = Yii::$ app ->request ->post ('name ' );
59
- //For attributes with format - relationName.attributeName
59
+ //For attributes with format - relationName.attributeName
60
60
if (strpos ($ attribute , '. ' )) {
61
61
$ attributeParts = explode ('. ' , $ attribute );
62
62
$ attribute = array_pop ($ attributeParts );
@@ -69,7 +69,7 @@ public function run()
69
69
throw new BadRequestHttpException ("Value cannot be empty. " );
70
70
}
71
71
/** @var \Yii\db\ActiveRecord $model */
72
- $ model = $ class ::findOne ([$ this ->pkColumn => $ pk ]);
72
+ $ model = $ class ::findOne (is_array ( $ pk ) ? $ pk : [$ this ->pkColumn => $ pk ]);
73
73
if (!$ model ) {
74
74
if ($ this ->forceCreate ) { // only useful for models with one editable attribute or no validations
75
75
$ model = new $ class ;
@@ -93,4 +93,4 @@ public function run()
93
93
}
94
94
}
95
95
96
- }
96
+ }
You can’t perform that action at this time.
0 commit comments