Saving custom registration fields to database
New to Vanilla Forums and plugin development for this platform and I have spent a considerable amount of time trying to find the answer in the forum and in other plugins but not really got anywhere.
I have added a custom field to my registration page 'Real Name' and whilst logged in, I can view it in the profile page and edit my profile, it modifies the value and saves/updates it in the database (manually added column in database table) - that is all working perfectly.
But on the registration page, the form just keeps returning the error 'RealName is required'.
1) Exactly what code determines whether a field is required or not? I can not see what sets this from the below...
echo $this->Form->Label('Real Name', 'RealName'); echo Wrap(sprintf(T('Not visible to other members.')), 'div', array('class' => 'Gloss')); echo $this->Form->TextBox('Real Name', array('autocorrect' => 'off', 'autocapitalize' => 'off', 'Wrap' => TRUE, 'Placeholder' => 'Real Name'));
2) How do I save this field to the database when saving the registration form? I fail to see any other similar scenario or existing example of this.
My modifications exist in a plugin and theme files. Please don't suggest ProfileExtender or some other plugin because they are not what I am looking for and do not resolve the scenario.