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

grous and pinned blocks don't have contexts, but get_child_contexts thinks they do

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.9.4
    • Fix Version/s: 1.9.5
    • Component/s: Roles / Access
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      function get_child_contexts($context) {
      // ...
      case CONTEXT_COURSE:
      // ...
      $sql = " SELECT ctx.*
      FROM

      {context} ctx
      WHERE ctx.path LIKE ?
      AND ctx.contextlevel IN (".CONTEXT_MODULE.",".CONTEXT_BLOCK.")
      UNION
      SELECT ctx.*
      FROM {context}

      ctx
      JOIN

      {groups}

      g ON (ctx.instanceid=g.id AND ctx.contextlevel=".CONTEXT_GROUP.")
      WHERE g.courseid=?
      UNION
      SELECT ctx.*
      FROM

      {context}

      ctx
      JOIN

      {block_pinned}

      b ON (ctx.instanceid=b.blockid AND ctx.contextlevel=".CONTEXT_BLOCK.")
      WHERE b.pagetype='course-view'";

      That is so wrong!

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            timhunt Tim Hunt
            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:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/May/09