Impossible to use OnAfterConfigRead event, when there is a system preset for a given unit config

2 views
Skip to first unread message

Alexander Obuhovich

unread,
Aug 17, 2011, 6:05:44 AM8/17/11
to In-Portal Bugs
It's impossible to use OnAfterConfigRead event, when there is a system preset for a given unit config.

For example this code in EUserEventHandler::OnAfterConfigRead method, used to make user's first name required:

$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.com
http://www.alex-time.com
apply_system_presets_before_onafterconfigread_event_called.patch
Reply all
Reply to author
Forward
0 new messages