public function actionUpdate($id)
    {
        if (!\Yii::$app->user->can('update'))
            return $this->alert(Module::t('core', 'Access denied.'));

        $model = $this->findModel($id);

        // $parent_node is empty, so it must be set
        if($one = $model->parents(1)->one())
        {
            $model->parent_node = $one->id;
            // new code
            $loaded = $model->load(\Yii::$app->request->post());
            
            // The General case
            if ($loaded && $model->save()) {
                return YII_DEBUG 
                    ? $this->redirect(['index'])
                    : $this->redirect(\Yii::$app->request->referrer);
            } else {
                return $this->renderAjax('update', [
                    'model' => $model,
                ]);
            }
        } else {
            \Yii::$app->session->setFlash(
                'warning',
                \Yii::t('core', 'Node has not parent.')
            );
            return $this->redirect(['index']);
        }
    }