-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.6, 4.2.3, 4.3
When that was first implemented in MDL-40672, 10 years ago,
And the following "activities" exist:
|
had this error 'handling' applied:
// Custom exception. |
try { |
$this->datagenerator->create_module($activityname, $data, $cmoptions); |
} catch (coding_exception $e) { |
throw new Exception('\'' . $activityname . '\' activity can not be added using this step,' . |
' use the step \'I add a "ACTIVITY_OR_RESOURCE_NAME_STRING" to section "SECTION_NUMBER"\' instead'); |
}
|
In all those years, I have never seen that message until today, and today it was just misleading.
In this case, the real error was
coding_exception: Coding error detected, it must be fixed by a programmer: Invalid availability structure (unknown ->op) in C:\Users\tjh238\workspace\moodle_head\availability\classes\tree.php:152
which came from my attempts to implement this: https://github.com/timhunt/moodle/commit/MDL-79798#diff-cf8371d9243575cafbfb3cd7ef9dd62ee698f139a0c3419ab740185982561385R14.
I think that, in 2023, that catch is not useful advice, so I propose we just remove it.