Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2363

Re: Wasted over a day and still can't get enrol_manual_enrol_users to work!!!!

$
0
0

by Eloy Lafuente (stronk7).  

Hi A W,

maybe it's not that the array element must be named... but that you need to pass an array of arrays? I mean, the 1st param is a "list of enrolment objects", aka an array. And the params themselves must be an array (aka, another array level). Total, 2 nested arrays.

In you latest post you are using such a correct double array. In your initial attempt you were using only 1 array level, hence it was unable to find "roleid" at the expected level.

So $params = array('enrolments' => array($enrolobj1, $enrolobj2, ...)) is for REST $curl->post(..., $params).

And $params = array(array($enrolobj1, $enrolobj2, ...)) is for XMLRPC $curl->post(..., xmlrpc_encode_request(..., $params).

So, double nested arrays (for that function that accepts an array of enrolments), keyed for REST and not keyed for XMLRPC (the xmlrpc server keys them back, by position, it's a limitation of XMLRPC, afaik).

Just guessing... ciao smile


Viewing all articles
Browse latest Browse all 2363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>