Moodle

print_recent_activity() assums activity

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8
  • Fix Version/s: 1.8.3, 1.9
  • Component/s: Course
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

If an activity module exists in the database, but it's files have been removed, print_recent_activity() (in course/lib.php) will try to include it anyways without checking if it exists. This produces an error message.

The include_once statement is on line 1125 for the current 1.8 stable version (1.484.2.27). It should check if the file exists first like it does in line 975.

Activity

Hide
Mike Churchward added a comment -

Changes made, but there really needs to be a way of flagging this as an error to admin level users.

Show
Mike Churchward added a comment - Changes made, but there really needs to be a way of flagging this as an error to admin level users.
Hide
Alan Trick added a comment -

Well, you can kind of do this by adding this in your config.php after the require_once("$CFG->dirroot/lib/setup.php"); bit.

if (has_capability('moodle/site:doanything',
get_context_instance(CONTEXT_SYSTEM))) {
$CFG->debug = DEBUG_DEVELOPER;
}

This won't alter $CFG->debug till after it's loaded most of the moodle code, so it won't catch everything, but that's probably as good as it gets.

Show
Alan Trick added a comment - Well, you can kind of do this by adding this in your config.php after the require_once("$CFG->dirroot/lib/setup.php"); bit. if (has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) { $CFG->debug = DEBUG_DEVELOPER; } This won't alter $CFG->debug till after it's loaded most of the moodle code, so it won't catch everything, but that's probably as good as it gets.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: