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

Exception when trying to load non-existing custom profile field

XMLWordPrintable

      As reported by tlock, as a regression from MDL-76873

      If the $CFG->showuseridentity configuration refers to an invalid custom profile field (because it was deleted after being set as the user identity) the following exception is observed when viewing course participants:

      Warning: Attempt to read property "datatype" on null in /opt/moodle/master/src/user/classes/fields.php on line 384
       
      Warning: Attempt to read property "id" on null in /opt/moodle/master/src/user/classes/fields.php on line 384
       
      Exception - profile_get_user_field(): Argument #1 ($type) must be of type string, null given, called in [dirroot]/user/classes/fields.php on line 384
       
      More information about this error
      Debug info:
      Error code: generalexceptionmessage
      Stack trace:
       
          line 609 of /user/profile/lib.php: TypeError thrown
          line 384 of /user/classes/fields.php: call to profile_get_user_field()
          line 142 of /user/classes/table/participants.php: call to core_user\fields::get_identity_fields()
          line 181 of /user/index.php: call to core_user\table\participants->out()
      

            pholden Paul Holden
            pholden Paul Holden
            Andrew Lyons Andrew Lyons
            Huong Nguyen Huong Nguyen
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 5 minutes
                1h 5m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.