Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-903

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

    XMLWordPrintable

    Details

    • 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

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: