Issue Details (XML | Word | Printable)

Key: MDL-16045
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Eloy Lafuente (stronk7)
Reporter: Jerome Mouneyrac
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Enrolment sync doesn't work

Created: 14/Aug/08 08:23 PM   Updated: 09/Sep/08 10:30 AM
Return to search
Component/s: Enrolments
Affects Version/s: 2.0
Fix Version/s: 2.0

File Attachments: 1. Text File MDL-16045.patch (0.9 kB)

Environment: LAMP - external database oracle
Issue Links:
Relates
 

Participants: Eloy Lafuente (stronk7) and Jerome Mouneyrac
Security Level: None
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
follow the moodle docs in order to run an enrolment sync: http://docs.moodle.org/en/External_database

When you run it, there is a loop.

The error is :
Notice: Undefined property: stdClass::$extuser in /home/jerome/Projects/Moodle_HEAD/moodle/enrol/database/enrol.php on line 282

Call Stack:
    0.0014 125416 1. {main}() /home/jerome/Projects/Moodle_HEAD/moodle/enrol/database/enrol_database_sync.php:0
    0.3043 21667088 2. enrolment_plugin_database->sync_enrolments() /home/jerome/Projects/Moodle_HEAD/moodle/enrol/database/enrol_database_sync.php:34

>>>>> extuser is the fieldname of userid in my external database

I added a print_r():
280. while ($crs_obj = (object)$crs->FetchRow()) {
281. $crs_obj = (object)array_change_key_case((array)$crs_obj , CASE_LOWER);
282. print_r($crs_obj);
283. array_push($extenrolments, $crs_obj->{$CFG->enrol_remoteuserfield});
284. }

I obtained this display:

stdClass Object
(
    [extuser] => 3
)
stdClass Object
(
    [extuser] => 4
)
stdClass Object
(
    [scalar] =>
)

I guess the scalar attribut cause problem (I didn't look further)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
No commits have yet been performed on this issue.