Load method not working for declared variables [solved]

I have many calls to $profile->load(Yii::$app->request->Post()) in my "Profile" controller. They have all been working for some time now, but strangely the non-db variables are not loading now.

If I call


those variables that are in the db will load into the model, but declared (non-db) variables do not. When I do a var_dump($_POST), I can see that $_POST['profile][‘variable…’] is populated with all of the form input, but for some reason the model object will have null values for all declared variables after calling the load method.

One of the changes I made before this trouble started was moving the app to a new sub domain on the same server. I’m not sure if that has anything to do with it. It seems to be working fine on the old sub domain.

I don’t think it has something to with the current issue.

The API doc says that:


Do the declared variables have the validation rules? If not, they are considered as unsafe and will not be populated by load().


Yes, that was the issue. I have a lot of variables and it looks like I missed a few in the validation rules. Thanks for the help!