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

Fix uses of delete_record(s) within one condition

    XMLWordPrintable

Details

    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • Easy

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Clockify

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