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

Remove the unnecessary emptiness check in delete_data_for_all_users_in_context()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.3.6, 3.4.3
    • Component/s: Privacy
    • Labels:

      Description

      In almost all implementations of delete_data_for_all_users_in_context, the first thing that comes is:

      if (empty($context)) {
          return;
      }
      

      However, if $context was empty the type declaration would fail. Therefore, there is no need for the above check.

      It seems that everyone is copying the same mistake, so it is better to clean up the code as soon as possible before almost all 3rd party devs do the same.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              markn Mark Nelson
              Reporter:
              rezaie9 Shamim Rezaie
              Peer reviewer:
              Simey Lameze
              Integrator:
              David Monllaó
              Tester:
              CiBoT
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/May/18