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

Check for regressions caused by accesslib updates

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2
    • Component/s: Libraries
    • Labels:

      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

              Assignee:
              skodak Petr Skoda
              Reporter:
              dougiamas Martin Dougiamas
              Integrator:
              Sam Hemelryk
              Tester:
              Sam Hemelryk
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Dec/11