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

middlename not returned by core_user_get_users external function

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.9.2
    • Fix Version/s: None
    • Labels:

      Description

      The middlename field is not returned by any combination of permissions (that I can find) in the core_user_get_users external function for web services. The place where it most likely should be handled, user_get_user_details in user/lib.php, conspicuously does not handle the middlename field but handles most every other field one would be interested in in the users table.

      Tracing this further, it also left out from user_get_default_fields.

      I believe that adding it to user_get_default_fields and then inserting a place right around:

      if ($isadmin or $canviewfullnames) {
      if (in_array('firstname', $userfields))

      { $userdetails['firstname'] = $user->firstname; }

      if (in_array('lastname', $userfields))

      { $userdetails['lastname'] = $user->lastname; }

      }
      $userdetails['fullname'] = fullname($user, $canviewfullnames);

      would be the right way to do it.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              bazzymg Basil Mohamed Gohar
              Peer reviewer:
              Ilya Tregubov Ilya Tregubov
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona), Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 15 minutes
                  15m