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

Error when moving a course to an empty category on Postgres

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.6.7, 1.7.5, 1.8.6, 1.9.1
    • Component/s: Course
    • Labels:
      None
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      The code was

      if ($sortorder === false) {

      however, on Postgres (at lease)

      get_field_sql('SELECT MIN(sortorder)-1 AS min
      FROM ' . $CFG->prefix . 'course WHERE category=' . $categoryid);

      returns NULL, not false, if the category you are moving to is empty.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            skodak Petr Skoda added a comment -

            thanks

            Show
            skodak Petr Skoda added a comment - thanks

              People

              • Assignee:
                timhunt Tim Hunt
                Reporter:
                timhunt Tim Hunt
                Tester:
                Petr Skoda
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/May/08