diff --git a/src/controllers/ServerController.php b/src/controllers/ServerController.php index 15bc4f41..1bc0a67a 100644 --- a/src/controllers/ServerController.php +++ b/src/controllers/ServerController.php @@ -183,7 +183,9 @@ public function actions() ], 'reinstall' => [ 'class' => SmartUpdateAction::class, - 'beforeSave' => function ($action) { + 'on beforeSave' => function (Event $event) { + /** @var Action $action */ + $action = $event->sender; foreach ($action->collection->models as $model) { $model->osmage = Yii::$app->request->post('osimage'); $model->panel = Yii::$app->request->post('panel'); @@ -194,7 +196,9 @@ public function actions() ], 'boot-live' => [ 'class' => SmartUpdateAction::class, - 'beforeSave' => function ($action) { + 'on beforeSave' => function (Event $event) { + /** @var Action $action */ + $action = $event->sender; foreach ($action->collection->models as $model) { $model->osmage = Yii::$app->request->post('osimage'); }