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

Fix uses of delete_record(s) within one condition

XMLWordPrintable

    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • Easy

      Since Moodle 2.0, the $DB->delete_records() method always return true. If some problem is found, it throws exception.

      So code like this:

      if ($DB->delete_records($table, $params)) {
          // Conditional code here
      ...

      Has no sense at all. Review all the current uses and change them to be linear / add extra checks if needed.

      Tip: grep -r "if" * | grep delete_records

      Ciao

            Unassigned Unassigned
            stronk7 Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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