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

The guest_user function should always return a user

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • 3.6.2
    • User management
    • MOODLE_36_STABLE

      When a Moodle site is misconfigured, it is possible for the function `guest_user` to return `false` instead of a user object, although most of the code I've seen assumes that `guest_user` will always return a valid user.

      This is likely happening when `$CFG->siteguest` was overridden but invalid, as deleting the guest user should not be possible.

      I would suggest to either change `guest_user` to always return a valid user object, and throw an exception when it cannot find one, or check that `siteguest` is valid when it is set in the config file.

      (This was identified from a bug reported in Level up!)

            Unassigned Unassigned
            fred Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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