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

"Invalid user" error when non-logged user attempts to access teacher profile

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4.2
    • Component/s: General
    • Labels:
    • Testing Instructions:
      Hide
      1. Set forceloginforprofiles and forcelogin to no.
      2. Enrol a teacher in a course
      3. Make sure you can view the link to your private files in the navigation block
      4. Logout and click on a teacher's name in the list of available courses on the front page
      5. Make sure you can view the profile
      Show
      Set forceloginforprofiles and forcelogin to no. Enrol a teacher in a course Make sure you can view the link to your private files in the navigation block Logout and click on a teacher's name in the list of available courses on the front page Make sure you can view the profile
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-37177-master

      Description

      I am setting up the latest Moodle 2.4+, but I cannot set teacher profile to show on front page for site visitors. I have set forceloginforprofiles to NO, but a site visitor on clicking TEACHER from the front page is redirected to this, all in a red block:

      Invalid user
      More information about this error

      I discussed this problem with Mary Cooch in https://moodle.org/mod/forum/discuss.php?d=218080 and she replicated the problem, which does not exist in Moodle 2.3.

      Steps to reproduce:

      1. Set forceloginforprofiles to no then log out
      2. Click on a teacher's name in the list of available courses on the front page

      The following error is obtained:

      Invalid user

      Debug info: SELECT id FROM

      {user}

      WHERE id = ? AND deleted = ?
      [array (
      0 => 0,
      1 => 0,
      )]
      Error code: invaliduser
      Stack trace:
      line 1357 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
      line 1333 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 6120 of /lib/accesslib.php: call to moodle_database->get_record()
      line 2158 of /lib/navigationlib.php: call to context_user::instance()
      line 1223 of /lib/navigationlib.php: call to global_navigation->load_for_user()
      line 3114 of /lib/navigationlib.php: call to global_navigation->initialise()
      line 700 of /lib/pagelib.php: call to settings_navigation->__construct()
      line 717 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
      line 137 of /user/profile.php: call to moodle_page->__get()

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Mar/13