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

Error on /admin/roles/admins.php if email removed from identity fields

    XMLWordPrintable

Details

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-73685-admin-role-bug-MOODLE_400_STABLE
    • MDL-73685-admin-role-bug
    • Hide
      1. Turn on debugging mode on by adding the following bit to your config.php or run mdk run dev command 

        $CFG->debug           = (E_ALL | E_STRICT); // DEBUG_DEVELOPER
        $CFG->debugdisplay    = 1;

      2. Have at least 2 users created on the site.
      3. As admin visit Administration > Users > Permissions > User policies
      4. Deselect 'Email address' and Save changes.
      5. Visit Administration > Users > Permissions > Site administrators
      6. Add another user as admin.
      7. Confirm there are no errors 
      Show
      Turn on debugging mode on by adding the following bit to your config.php or run mdk run dev command  $CFG->debug           = (E_ALL | E_STRICT); // DEBUG_DEVELOPER $CFG->debugdisplay    = 1 ; Have at least 2 users created on the site. As admin visit Administration > Users > Permissions > User policies Deselect 'Email address' and Save changes. Visit Administration > Users > Permissions > Site administrators Add another user as admin. Confirm there are no errors 

    Description

      On my 4.0 dev site the email is unchecked in User policies > Show user identities. When I go to add a new site admin or check existing admins an error appears:
      Notice: Undefined property: stdClass::$email in /opt/app/admin/roles/classes/admins_existing_selector.php on line 90

      Attachments

        1. errorsiteadmin.png
          errorsiteadmin.png
          56 kB
        2. MDL-73685_master.png
          MDL-73685_master.png
          59 kB
        3. MDL-73685_v400.png
          MDL-73685_v400.png
          56 kB

        Issue Links

          Activity

            People

              brendanheywood Brendan Heywood
              marycooch Mary Cooch
              Andrew Madden Andrew Madden
              Simey Lameze Simey Lameze
              John Edward Pedregosa John Edward Pedregosa
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/Sep/22

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 54 minutes
                  54m