-
Bug
-
Resolution: Fixed
-
Minor
-
3.6.3
-
MOODLE_36_STABLE
-
MOODLE_36_STABLE
-
MDL-65104-master -
core\hub\registration initialises the static variable $registration to null, and we make an === check to see if it is null in get_registration
However, straight after that, we have:
self::$registration = $DB->get_record('registration_hubs', ['huburl' => HUB_MOODLEORGHUBURL]);
The issue is that the DML can return false, and the triple equality check can fail on subsequent calls to require_registration
This bit us on cloud, where we have our own adhoc task to manage registrations; which runs after core's registration_cron_task. Core's task caused $registration to be set to false, and then when we tried to retrieve the registration in our own task, it was not loaded from the DB (as the === test failed).