Moodle

Error when moving a course to an empty category on Postgres

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor 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.

Activity

Hide
Petr Škoda (skodak) added a comment -

thanks

Show
Petr Škoda (skodak) added a comment - thanks

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: