I followed the
Adding Visibility Options to Your Member Profile Pages tutorial exactly but
submitting the form always fails due to an "Unknown property: profileVisibility" error.
I double- and triple checked the code for any typos but I cannot find any. The form-data
is submitted properly but calling "$user->save();" always breaks it.
snippet from /widgets/index/models/user.php
[code]
.....
public $displayGender;
public $displayGender_choices = array('Y','N');
// additional option to toggle profile visibility
public $profileVisibility;
public $profileVisibility_choices = array('all', 'friends', 'me');
/** xn-ignore-start 2365cb7691764f05894c2de6698b7da0 **/
// Everything other than instance variables goes below here
.....
[/code]
snippet from /widgets/profiles/controllers/ProfileController.php
[code]
.....
$user->my->activityEvents = $_POST['activityEvents'] ? 'Y' : 'N';
}
$user->my->profileVisibility = $_POST['profileVisibility'];
$user->save();
........
[/code]
As far as I have seen in the documentation for the XNS/"Ning Content Store", the
property should exist as soon as I first call or declare it. So actually the line
"$user->my->profileVisibility = $_POST['profileVisibility'];" should be enough.
Or does anyone know what important part I am missing?