{"record":{"id":"49dbe37463e3120f","repo":"moodle/moodle","slug":"the-user-competency-id-must-be-set-review-started","errorCode":null,"errorMessage":"The user competency ID must be set.","messagePattern":"The user competency ID must be set\\.","errorType":"exception","errorClass":"coding_exception","httpStatus":null,"severity":"error","filePath":"public/lib/classes/event/competency_user_competency_review_started.php","lineNumber":50,"sourceCode":" * User competency review started event class.\n *\n *\n * @package    core_competency\n * @since      Moodle 3.1\n * @copyright  2016 Issam Taboubi <issam.taboubi@umontreal.ca>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nclass competency_user_competency_review_started extends base {\n\n    /**\n     * Convenience method to instantiate the event.\n     *\n     * @param user_competency $usercompetency The user competency.\n     * @return self\n     */\n    public static function create_from_user_competency(user_competency $usercompetency) {\n        if (!$usercompetency->get('id')) {\n            throw new \\coding_exception('The user competency ID must be set.');\n        }\n        $params = array(\n            'contextid' => $usercompetency->get_context()->id,\n            'objectid' => $usercompetency->get('id'),\n            'relateduserid' => $usercompetency->get('userid')\n        );\n\n        $event = static::create($params);\n        $event->add_record_snapshot(user_competency::TABLE, $usercompetency->to_record());\n        return $event;\n    }\n\n    /**\n     * Returns description of what happened.\n     *\n     * @return string\n     */\n    public function get_description() {","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/moodle/moodle/blob/48ea8c33227277e916cdd4079dbecef448b37f2c/public/lib/classes/event/competency_user_competency_review_started.php#L32-L68","documentation":"Guard in the S3 Transfer constructor's option validation. It fires when the caller supplies options['after'] (a callback invoked after each multipart upload part completes) whose value fails is_callable() — e.g. a string, number, or malformed array. The identical check for the 'before' option appears just above. Fix by passing a genuine PHP callable (closure, function name string, or valid [object,'method'] array), or omitting the 'after' option entirely.","triggerScenarios":"Thrown at public/lib/classes/event/competency_user_competency_review_started.php:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Save the user_competency persistent (->create()) before triggering the event","Load the existing record instead of constructing a new unsaved one"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"48ea8c33227277e916cdd4079dbecef448b37f2c","analyzedAt":"2026-09-14T20:34:48.527Z","contentChangedAt":"2026-09-14T20:34:48.527Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}