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

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.5
    • 3.3.6, 3.4.3
    • Privacy

    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

              markn Mark Nelson
              rezaie9 Shamim Rezaie
              Simey Lameze Simey Lameze
              David Monllaó David Monllaó
              CiBoT CiBoT
              Andrew Lyons, Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                17/May/18