File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public function run()
5656 $ class = $ this ->modelClass ;
5757 $ pk = Yii::$ app ->request ->post ('pk ' );
5858 $ attribute = Yii::$ app ->request ->post ('name ' );
59- //For attributes with format - relationName.attributeName
59+ //For attributes with format - relationName.attributeName
6060 if (strpos ($ attribute , '. ' )) {
6161 $ attributeParts = explode ('. ' , $ attribute );
6262 $ attribute = array_pop ($ attributeParts );
@@ -69,7 +69,7 @@ public function run()
6969 throw new BadRequestHttpException ("Value cannot be empty. " );
7070 }
7171 /** @var \Yii\db\ActiveRecord $model */
72- $ model = $ class ::findOne ([$ this ->pkColumn => $ pk ]);
72+ $ model = $ class ::findOne (is_array ( $ pk ) ? $ pk : [$ this ->pkColumn => $ pk ]);
7373 if (!$ model ) {
7474 if ($ this ->forceCreate ) { // only useful for models with one editable attribute or no validations
7575 $ model = new $ class ;
@@ -93,4 +93,4 @@ public function run()
9393 }
9494 }
9595
96- }
96+ }
You can’t perform that action at this time.
0 commit comments