Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-51506

Implement validation mechanisms in persistent derived classes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.2
    • Fix Version/s: None
    • Component/s: Competencies
    • Labels:
      None
    • Story Points:
      2
    • Sprint:
      CBE Sprint 0

      Description

      We need the models (persistent classes) to be able to validate themselves. The main reason behind this is that we cannot trust the data that is coming from other sources than web services or forms, for instance data manipulated by a developer, data from other sources such as CSV files, etc...

      The API methods are not the right place to put this validation because the persistent classes can be used directly and enforcing the API use will be very difficult.

      Defining validation within the model is the first step, later on we could re-use the validation definitions in forms, or even in external functions parameters/return definitions.

      When working on this, grep for TODOs related to MDL-51506.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fred Frédéric Massart
              Reporter:
              fred Frédéric Massart
              Peer reviewer:
              Damyon Wiese
              Participants:
              Component watchers:
              Damyon Wiese, Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: