Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-54042

webservice core_user_get_users_by_field shows debugging: Undefined proprty

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.9.5, 3.0.3, 3.1
    • 2.9.7, 3.0.5
    • Web Services
    • MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • MDL-54042-master
    • Hide

      Run ./vendor/bin/phpunit user/tests/userlib_test.php and confirm it passes.

      Revert the first commit in the branch (the one with the fix - not the test).

      Re-run the test and confirm it fails.

      Show
      Run ./vendor/bin/phpunit user/tests/userlib_test.php and confirm it passes. Revert the first commit in the branch (the one with the fix - not the test). Re-run the test and confirm it fails.

    Description

      Steps to replicate:

      1. Login as teacher
      2. Go to assignment and click "View all submissions"
      3. Click on "Grade" for any student

      Check php error logs and you will observe following:

      [Wed May 04 12:22:34.646569 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP Notice:  Undefined property: stdClass::$defaultgroupingid in /home/rajesh/moodles/im/moodle/user/lib.php on line 515, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.646612 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP Stack trace:, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.646623 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP   1. {main}() /home/rajesh/moodles/im/moodle/lib/ajax/service.php:0, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.646630 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP   2. external_api::call_external_function() /home/rajesh/moodles/im/moodle/lib/ajax/service.php:53, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.646636 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP   3. call_user_func_array:{/home/rajesh/moodles/im/moodle/lib/externallib.php:229}() /home/rajesh/moodles/im/moodle/lib/externallib.php:229, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.646643 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP   4. core_user_external::get_users_by_field() /home/rajesh/moodles/im/moodle/lib/externallib.php:229, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.646673 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP   5. user_get_user_details_courses() /home/rajesh/moodles/im/moodle/user/externallib.php:545, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.646679 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP   6. user_get_user_details() /home/rajesh/moodles/im/moodle/user/lib.php:583, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.654521 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP Notice:  Undefined property: stdClass::$defaultgroupingid in /home/rajesh/moodles/im/moodle/user/lib.php on line 515, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.654557 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP Stack trace:, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.654567 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP   1. {main}() /home/rajesh/moodles/im/moodle/lib/ajax/service.php:0, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.654574 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP   2. external_api::call_external_function() /home/rajesh/moodles/im/moodle/lib/ajax/service.php:53, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.654581 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP   3. call_user_func_array:{/home/rajesh/moodles/im/moodle/lib/externallib.php:229}() /home/rajesh/moodles/im/moodle/lib/externallib.php:229, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.654603 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP   4. core_user_external::get_users_by_field() /home/rajesh/moodles/im/moodle/lib/externallib.php:229, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.654610 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP   5. user_get_user_details_courses() /home/rajesh/moodles/im/moodle/user/externallib.php:545, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      [Wed May 04 12:22:34.654615 2016] [:error] [pid 32523] [client 172.20.0.33:35019] PHP   6. user_get_user_details() /home/rajesh/moodles/im/moodle/user/lib.php:583, referer: http://rajesh.per.in.moodle.com/im/mod/assign/view.php?id=67&rownum=0&action=grader&userid=3
      

      Credit goes to fred for finding this problem.

      Alternatively run behat mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature and check error logs.

      Attachments

        Issue Links

          Activity

            People

              damyon Damyon Wiese
              rajeshtaneja Rajesh Taneja
              Jun Pataleta Jun Pataleta
              Dan Poltawski Dan Poltawski
              Adrian Greeve Adrian Greeve
              Juan Leyva, David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/Jul/16