Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.1
    • Fix Version/s: 2.0.4, 2.1.1, 2.2
    • Component/s: Enrolments, Roles / Access
    • Labels:
      None
    • Environment:
      IIS 7.5 Win 2008R2 MS SQL 2008 R2
    • Database:
      Microsoft SQL
    • Testing Instructions:
      Hide

      1/ set up meta sync
      2/ use meta sync in several courses
      3/ modify the user enrolments in the source course - add/remove users and assign/unassign roles
      4/ delete users that synced

      Show
      1/ set up meta sync 2/ use meta sync in several courses 3/ modify the user enrolments in the source course - add/remove users and assign/unassign roles 4/ delete users that synced
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w28_MDL-28348_m22_meta
    • Rank:
      17993

      Description

      Coding error detected, it must be fixed by a programmer: invalid enrol instance!

      When using Accounts
      Bulk User Admin

      Select Users using a filter
      Choose Delete

      I find that when I select to Delete the students I get the "Coding Error" detected message above.

      I am using LDAP for student authentication.

      Edit: I have discovered 2 more problems when fixing this issue
      1/ missing circular reference protection
      2/ roles were not unsassigned properly

        Activity

        Hide
        Petr Škoda added a comment -

        Hello,

        I am sorry I can not reproduce this problem and I can not find any problem in code either. This might be caused by broken enrol plugin, did you modify your moodle in any way or install any 3rd party plugin?

        I would need a full stacktrace from the error to diagnose the problem properly, please turn on the max debug mode in your moodle configuration and to delete the users again, you should get error message with more information and paste it here, thanks!

        Petr

        Show
        Petr Škoda added a comment - Hello, I am sorry I can not reproduce this problem and I can not find any problem in code either. This might be caused by broken enrol plugin, did you modify your moodle in any way or install any 3rd party plugin? I would need a full stacktrace from the error to diagnose the problem properly, please turn on the max debug mode in your moodle configuration and to delete the users again, you should get error message with more information and paste it here, thanks! Petr
        Hide
        James Cracknell added a comment -

        Hi Petr

        Stack trace:
        line 1178 of \lib\enrollib.php: coding_exception thrown
        line 163 of \enrol\meta\locallib.php: call to enrol_plugin->unenrol_user()
        line ? of unknownfile: call to enrol_meta_handler::user_unenrolled()
        line 296 of \lib\eventslib.php: call to call_user_func()
        line 518 of \lib\eventslib.php: call to events_dispatch()
        line 1200 of \lib\enrollib.php: call to events_trigger()
        line 1516 of \lib\enrollib.php: call to enrol_plugin->unenrol_user()
        line 749 of \lib\enrollib.php: call to enrol_plugin->user_delete()
        line 3435 of \lib\moodlelib.php: call to enrol_user_delete()
        line 30 of \admin\user\user_bulk_delete.php: call to delete_user()

        Show
        James Cracknell added a comment - Hi Petr Stack trace: line 1178 of \lib\enrollib.php: coding_exception thrown line 163 of \enrol\meta\locallib.php: call to enrol_plugin->unenrol_user() line ? of unknownfile: call to enrol_meta_handler::user_unenrolled() line 296 of \lib\eventslib.php: call to call_user_func() line 518 of \lib\eventslib.php: call to events_dispatch() line 1200 of \lib\enrollib.php: call to events_trigger() line 1516 of \lib\enrollib.php: call to enrol_plugin->unenrol_user() line 749 of \lib\enrollib.php: call to enrol_plugin->user_delete() line 3435 of \lib\moodlelib.php: call to enrol_user_delete() line 30 of \admin\user\user_bulk_delete.php: call to delete_user()
        Hide
        Petr Škoda added a comment -

        I think I have found the problem, thanks a lot!

        Show
        Petr Škoda added a comment - I think I have found the problem, thanks a lot!
        Hide
        Petr Škoda added a comment -

        Thanks a lot for the report and cooperation!

        Show
        Petr Škoda added a comment - Thanks a lot for the report and cooperation!
        Hide
        James Cracknell added a comment -

        No probs. Thanks to you for fixing it. With my feeble PHP skills I could never do it!

        Show
        James Cracknell added a comment - No probs. Thanks to you for fixing it. With my feeble PHP skills I could never do it!
        Hide
        Sam Hemelryk added a comment -

        Thanks guys - interesting wee bug, good too see it fixed.
        Cheers
        Sam

        Show
        Sam Hemelryk added a comment - Thanks guys - interesting wee bug, good too see it fixed. Cheers Sam
        Hide
        David Mudrak added a comment -

        Tested. I set up a parent course and a child course with instance of enrol_meta. Was able to successfully test enrolling new users, removing enrolments, adding roles, removing roles via meta. One of the users were deleted then and the sync worked normally with the expected results.

        Show
        David Mudrak added a comment - Tested. I set up a parent course and a child course with instance of enrol_meta. Was able to successfully test enrolling new users, removing enrolments, adding roles, removing roles via meta. One of the users were deleted then and the sync worked normally with the expected results.
        Hide
        James Cracknell added a comment -

        Hi

        I tried bulk delete this AM using CVS Moodle_21_Weekly (latest) and it wouldn't work again. Sorry I didn't get the error message - well I did but closed down the window in error. In the end I removed the problem manually. Just wondered if something else similar has been altered again.

        James

        Show
        James Cracknell added a comment - Hi I tried bulk delete this AM using CVS Moodle_21_Weekly (latest) and it wouldn't work again. Sorry I didn't get the error message - well I did but closed down the window in error. In the end I removed the problem manually. Just wondered if something else similar has been altered again. James
        Hide
        James Cracknell added a comment -

        Saying that I did record it!. Will start a new issue if needed.

        Debug info: SQLState: 42000<br>
        Error Code: 8114<br>
        Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Error converting data type nvarchar to numeric.<br>

        SELECT TOP 1 'x' FROM mdl_user WHERE username = 1.1321789548
        [array (
        0 => 1.1321789548,
        )]
        Stack trace:
        line 394 of \lib\dml\moodle_database.php: dml_read_exception thrown
        line 252 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
        line 368 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
        line 773 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
        line 1587 of \lib\dml\moodle_database.php: call to sqlsrv_native_moodle_database->get_recordset_sql()
        line 1572 of \lib\dml\moodle_database.php: call to moodle_database->record_exists_sql()
        line 1556 of \lib\dml\moodle_database.php: call to moodle_database->record_exists_select()
        line 3467 of \lib\moodlelib.php: call to moodle_database->record_exists()
        line 30 of \admin\user\user_bulk_delete.php: call to delete_user()

        Show
        James Cracknell added a comment - Saying that I did record it!. Will start a new issue if needed. Debug info: SQLState: 42000<br> Error Code: 8114<br> Message: [Microsoft] [SQL Server Native Client 10.0] [SQL Server] Error converting data type nvarchar to numeric.<br> SELECT TOP 1 'x' FROM mdl_user WHERE username = 1.1321789548 [array ( 0 => 1.1321789548, )] Stack trace: line 394 of \lib\dml\moodle_database.php: dml_read_exception thrown line 252 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end() line 368 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end() line 773 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query() line 1587 of \lib\dml\moodle_database.php: call to sqlsrv_native_moodle_database->get_recordset_sql() line 1572 of \lib\dml\moodle_database.php: call to moodle_database->record_exists_sql() line 1556 of \lib\dml\moodle_database.php: call to moodle_database->record_exists_select() line 3467 of \lib\moodlelib.php: call to moodle_database->record_exists() line 30 of \admin\user\user_bulk_delete.php: call to delete_user()

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: