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

Error when moving a course to an empty category on Postgres

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9
    • 1.6.7, 1.7.5, 1.8.6, 1.9.1
    • Course
    • None
    • PostgreSQL
    • MOODLE_19_STABLE
    • 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.

      Attachments

        Activity

          People

            timhunt Tim Hunt
            timhunt Tim Hunt
            Petr Skoda Petr Skoda
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              15/May/08