I am stuck and would thank anyone for a suggestion how to proceed.
I am writing an authentication plugin cron method (Moodle 2.2.2), and my call to
seems to succeed. I traced execution all the way into mysqli_native_moodle_database's insert_record_raw method, and all seems fine. I get back a new user id from the call to
$id = $this->mysqli->insert_id;
and there are no errors or exceptions I can see.
The only small problem is that the records are not to be found in the mdl_user table afterwards! It is almost as if something is rolling back the changes.
I tried using $transaction = $DB->start_delegated_transaction(); and $transaction->allow_commit(); bracketing these operations-- and also trying without these calls. Either way everything SEEMS to be executing without a problem. But no user records are actually added!
I cannot find anything useful in the error logs. Turning on debugging has not shown me anything, either.
What can I do? Any suggestions? I am working in a Windows environment. It's Moodle 2.2.2. I am not sure how to increase MySQL logging higher than it is. But the fact is that I get a new user id back from the call to MySQL, as I said above. Why would the insert be rolled back? Note that the id is "used" so that on subsequent runs the id returned is the next greater id available.