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

Check for regressions caused by accesslib updates

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.2
    • 2.2
    • Libraries

    Description

      After the accesslib changes in MDL-29602, a number of regressions have been found.

      In 2.2, get_context_instance(xxxxx, CONTEXT_USER) can now return false in some cases (like if the user is deleted).

      However, some old code always assumes that a context is returned eg:

       $usercontextid = get_context_instance(CONTEXT_USER, $userid)->id;

      Someone must check all the calls to get_context_instance(xxxxx, CONTEXT_USER) and make sure they are handling the case of a returned "false" correctly, eg for the above:

       $usercontext = get_context_instance(CONTEXT_USER, $userid);
       
       if (!$usercontext) {
          continue;
       }

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda
              dougiamas Martin Dougiamas
              Sam Hemelryk Sam Hemelryk
              Sam Hemelryk Sam Hemelryk
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                5/Dec/11