-
Bug
-
Resolution: Fixed
-
Minor
-
4.3
-
MOODLE_403_STABLE
-
MOODLE_402_STABLE, MOODLE_403_STABLE
-
MDL-80098-403 -
- Covered by automated tests (PHPUnit)
The exception thrown in /lib/modinfolib.php in get_course_and_cm_from_instance() has incorrect syntax:
throw new moodle_exception('invalidmoduleid', 'error', $instanceid);
While it should be:
throw new moodle_exception('invalidmoduleid', 'error', null, $instanceid);
This results in error messages displayed as "Invalid module ID: {$a}"
According to the moodle_exception's constructor in /lib/setuplib.php the 3rd parameter is the link to the error page and only the 4th parameter is the content of {$a}
To reproduce:
<?php
require_once(_DIR_ . '/config.php');
throw new moodle_exception('invalidmoduleid', 'error', 11);