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

Remove the unnecessary emptiness check in delete_data_for_all_users_in_context()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.3.6, 3.4.3
    • 3.5
    • Privacy

      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.

            markn Mark Nelson
            rezaie9 Shamim Rezaie
            Simey Lameze Simey Lameze
            David Monllaó David Monllaó
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.