thyseus / yii-user-management

a user management module collection for the yii framework
186 stars 122 forks source link

Error 500 Undefined variable: profile at YumPrivacysettingController.php #192

Open Abdulrazak-Alkl opened 10 years ago

Abdulrazak-Alkl commented 10 years ago

When i try to submit the privacy setting update form, the debugger stop at $profile->save(); because $profile is not defined. There is no YumProfile submitted from privacy/update form.

        if(isset($_POST['YumProfile'])) {
            $profile = $model->user->profile;
            $profile->attributes = $_POST['YumProfile'];
            $profile->validate();
        }

        if(!$model->hasErrors()) {
            $profile->save();
            $model->save();
            Yum::setFlash('Your privacy settings have been saved');
            $this->redirect(array('//profile/profile/view', 'id' => $model->user_id));
        }

even i don't get it, why we need to send the profile model (YumProfile) to privacy update form, if we don't use it there !? There is no relation between YumPrivacysetting and YumProfile.