/**
* Process data from submitted form
*
* @param stdClass $data
* @param stdClass $course
* @return void
* See plugin_extend_coursemodule_edit_post_actions in
* https://github.com/moodle/moodle/blob/master/course/modlib.php
*/
function local_callbacks_coursemodule_edit_post_actions($data, $course) {
// Pull apart $data and insert/update the database table.
}
But if you don't return $data for subsequent plugins in the chain this method will fail with, for example, PHP Notice: Trying to get property 'modulename' of non-object.
So should the PHPDoc @return change, and an explicit return be included in the function body?:
/**
* Process data from submitted form
*
* @param stdClass $data
* @param stdClass $course
* @return stdClass
* See plugin_extend_coursemodule_edit_post_actions in
* https://github.com/moodle/moodle/blob/master/course/modlib.php
*/
function local_callbacks_coursemodule_edit_post_actions($data, $course) {
// Pull apart $data and insert/update the database table.
return $data;
}
(Thanks for this code BTW, it helped me update an old plugin).
lib.php
has:But if you don't return
$data
for subsequent plugins in the chain this method will fail with, for example, PHP Notice: Trying to get property 'modulename' of non-object.So should the PHPDoc
@return
change, and an explicitreturn
be included in the function body?:(Thanks for this code BTW, it helped me update an old plugin).