It's impossible to use OnAfterConfigRead event, when there is a system preset for a given unit config.
$fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
$fields['FirstName']['required'] = 1;
$this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
has no effect, when current system preset (e.g. "simple" system preset) has "users_u.php" that resets all required fields anyway.
To solve that I'm proposing to apply system preset imposed changed before calling OnAfterConfigRead event. This way any code in OnAfterConfigRead even will override whatever system preset is imposing.
That's how it worked before system presets were invented.
Ready for testing.
--
Best Regards,
http://www.in-portal.comhttp://www.alex-time.com