-
Type: Bug Report
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 5.1.3-RC2
-
Fix Version/s: 5.1.3
-
Component/s: Data Management
-
Labels:None
-
External issue URL:
-
Change Log Message:Fixes some code of OnAfterConfigRead event was overwritten from system preset problem
-
External issue ID:1104
-
Copy Issue Key:
-
Patch Instructions:
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.