Posts made by Guillermo Madero

Second debugging info

After taking a look at the previous debugging info, it seemed strange to me that at the do_group function, the first debugging line (debugging("trying to enrol user now");) from the if (isloggedin()){ section was not the one displayed (which I thought it would... after all, the user is logged in), and so I decided to change that line like so: if (!isloggedin()){ and do the test again (after having unroled the users from the course).

I logged in with user-1 and this time I got the following info:

Debug info: SELECT * FROM {user} WHERE id = ?
[array (
0 => 0,
)] 
Error code: invaliduser
Stack trace:
line 1385 of \lib\dml\moodle_database.php: dml_missing_record_exception thrown
line 1361 of \lib\dml\moodle_database.php: call to moodle_database->get_record_select()
line 52 of \group\lib.php: call to moodle_database->get_record()
line 374 of \enrol\autoenrol\lib.php: call to groups_add_member()
line 185 of \enrol\autoenrol\lib.php: call to enrol_autoenrol_plugin->do_group()
line 215 of \lib\enrollib.php: call to enrol_autoenrol_plugin->sync_user_enrolments()
line 4312 of \lib\moodlelib.php: call to enrol_check_plugins()
line 182 of \login\index.php: call to complete_user_login()
Output buffer:
trying to enrol user now
  • line 344 of \enrol\autoenrol\lib.php: call to debugging()
  • line 185 of \enrol\autoenrol\lib.php: call to enrol_autoenrol_plugin->do_group()
  • line 215 of \lib\enrollib.php: call to enrol_autoenrol_plugin->sync_user_enrolments()
  • line 4312 of \lib\moodlelib.php: call to enrol_check_plugins()
  • line 182 of \login\index.php: call to complete_user_login()


Notice: Undefined property: stdClass::$auth in X:\mymoodle\enrol\autoenrol\lib.php on line 347

Notice: Undefined property: stdClass::$department in X:\mymoodle\enrol\autoenrol\lib.php on line 347

Notice: Undefined property: stdClass::$institution in X:\mymoodle\enrol\autoenrol\lib.php on line 347

Notice: Undefined property: stdClass::$lang in X:\mymoodle\enrol\autoenrol\lib.php on line 347

Auto|g_
  • line 357 of \enrol\autoenrol\lib.php: call to debugging()
  • line 185 of \enrol\autoenrol\lib.php: call to enrol_autoenrol_plugin->do_group()
  • line 215 of \lib\enrollib.php: call to enrol_autoenrol_plugin->sync_user_enrolments()
  • line 4312 of \lib\moodlelib.php: call to enrol_check_plugins()
  • line 182 of \login\index.php: call to complete_user_login()
group not found, adding it now
  • line 361 of \enrol\autoenrol\lib.php: call to debugging()
  • line 185 of \enrol\autoenrol\lib.php: call to enrol_autoenrol_plugin->do_group()
  • line 215 of \lib\enrollib.php: call to enrol_autoenrol_plugin->sync_user_enrolments()
  • line 4312 of \lib\moodlelib.php: call to enrol_check_plugins()
  • line 182 of \login\index.php: call to complete_user_login()

After selecting the Continue button, the user-2 was kicked out (logged out).

 

I then logged in as admin and went to check the course. This time:

  • user user-1 was enroled, as expected.
  • a group Auto|g_ was created (notice that that string appears at the debug info) with the following group description:
This group has been automatically created by the Auto Enrol plugin. It will be deleted if you remove the Auto Enrol plugin from the course.

 

After logging in with user-2, I got:

Debug info: SELECT * FROM {user} WHERE id = ?
[array (
0 => 0,
)]
Error code: invaliduser
Stack trace:
line 1385 of \lib\dml\moodle_database.php: dml_missing_record_exception thrown
line 1361 of \lib\dml\moodle_database.php: call to moodle_database->get_record_select()
line 52 of \group\lib.php: call to moodle_database->get_record()
line 374 of \enrol\autoenrol\lib.php: call to groups_add_member()
line 185 of \enrol\autoenrol\lib.php: call to enrol_autoenrol_plugin->do_group()
line 215 of \lib\enrollib.php: call to enrol_autoenrol_plugin->sync_user_enrolments()
line 4312 of \lib\moodlelib.php: call to enrol_check_plugins()
line 182 of \login\index.php: call to complete_user_login()
Output buffer:
trying to enrol user now
  • line 344 of \enrol\autoenrol\lib.php: call to debugging()
  • line 185 of \enrol\autoenrol\lib.php: call to enrol_autoenrol_plugin->do_group()
  • line 215 of \lib\enrollib.php: call to enrol_autoenrol_plugin->sync_user_enrolments()
  • line 4312 of \lib\moodlelib.php: call to enrol_check_plugins()
  • line 182 of \login\index.php: call to complete_user_login()

Notice: Undefined property: stdClass::$auth in X:\mymoodle\enrol\autoenrol\lib.php on line 347

Notice: Undefined property: stdClass::$department in X:\mymoodle\enrol\autoenrol\lib.php on line 347

Notice: Undefined property: stdClass::$institution in X:\mymoodle\enrol\autoenrol\lib.php on line 347

Notice: Undefined property: stdClass::$lang in X:\mymoodle\enrol\autoenrol\lib.php on line 347
Auto|g_
  • line 357 of \enrol\autoenrol\lib.php: call to debugging()
  • line 185 of \enrol\autoenrol\lib.php: call to enrol_autoenrol_plugin->do_group()
  • line 215 of \lib\enrollib.php: call to enrol_autoenrol_plugin->sync_user_enrolments()
  • line 4312 of \lib\moodlelib.php: call to enrol_check_plugins()
  • line 182 of \login\index.php: call to complete_user_login()

As before, user-2 was logged out but enroled into the course.

 

Well, the release 1.2 plugin certainly seems to have a bug; I hope this information will help finding it and fixing it.

First debugging info

After I:

  • Enabled debugging.
  • Uncommented the 5 debugging lines in autoenrol/lib.php.

I got the following info:

this shouldnt be possible!
line 384 of \enrol\autoenrol\lib.php: call to debugging()
line 185 of \enrol\autoenrol\lib.php: call to enrol_autoenrol_plugin->do_group()
line 215 of \lib\enrollib.php: call to enrol_autoenrol_plugin->sync_user_enrolments()
line 4312 of \lib\moodlelib.php: call to enrol_check_plugins()
line 182 of \login\index.php: call to complete_user_login()

 

Hi,

I'm using Moodle 2.5.9 and installed the AutoEnrol plugin (release 1.2, version 2013070100, from Mark Ward).

The plugin installed and works fine, except that I haven't been able to figure out how the group creation/assignment capability works.

The plugin is set as follows:

* General
Custom Label: ---
Role: Student
Enrol When: Logging into Site
Always Enrol: No
* User Filtering
Group By: Department
Allow Only: g_
Soft Match: Yes
Limit: 0

I have three test users:

user-0, with Department field empty
user-1, with Department field = g_a01
user-2, with Department field = g_b02

And a course:

  • defined with Group mode=Separate groups & Force group mode=Yes.
  • with only one group named g_a01.

After login-in with the three users:

  • user-1 and user-2 are enroled into the course, just as expected.
  • user-0 is not, just as expected.

However:

  • user user-1 is not assigned to group g_a01.
  • group g_b02 is not created (and evidently, user-2 is also left unassigned to any group).

 Is this the expected and correct way the plugin works?

I may just have misunderstood the description regarding groups:

In addition the plugin has advanced functionality to support autmatically grouping and filtering users based upon their attributes. Depending on how your user accounts are setup this may help you to give access to certain user groups.

but I thought that after a user logs in and gets enroled, the plugin would create the required group (based on the value of the Department field) if it didn't already exist, and also assign the user into the group.

 

Thanks beforehand

Average of ratings: -