enrol_manual_enrol_users always returns Null

enrol_manual_enrol_users always returns Null

by Rixan Randria -
Number of replies: 0

Hello.

I definitely have the same problem as this old discussion with no answers : https://moodle.org/mod/forum/discuss.php?d=350722

the difference is they use Soap, I use Rest

The function just returned "Null" with no exception error.

$user2enrol001 = array( "roleid" => 5, "userid" => 6, "courseid" => 4 );

$user2enrol002 = array( "roleid" => 5, "userid" => 7, "courseid" => 4 );

$user2enrol003 = array( "roleid" => 5, "userid" => 8, "courseid" => 4 );

array_push($enrolments, $user2enrol001, $user2enrol002, $user2enrol003);

$json = $MoodleRest->request('enrol_manual_enrol_users', array("enrolments" => $enrolments));

echo $json;


Ce dernier echo affiche juste "Null"

Average of ratings: -