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

code uses hard-coded integer values instead of defined, human-readable strings

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Authentication
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      What does "2" mean? I don't know. Ah – look at the HTML:

      <option value="0" selected="selected">Keep internal</option>
      <option value="1">Suspend internal</option>
      <option value="2">Full delete internal</option>

      The code should use, e.g., AUTH_REMOVEUSER_KEEP, AUTH_REMOVEUSER_SUSPEND, and AUTH_REMOVEUSER_FULLDELETE instead of 0, 1, and 2.

      I'll submit a patch for 2.0 shortly, because I suppose it's not worth changing released versions. This will NOT change functionality, it will only improve code readability (which should cut down on future bug introduction, developer frustration, etc.)

        Attachments

          Activity

            People

            Assignee:
            dongsheng Dongsheng Cai
            Reporter:
            moquist Matt Oquist
            Tester:
            Andrew Davis
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10