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

Inheritance does not work as it should

    XMLWordPrintable

    Details

    • Sprint:
      GDPR Followup Sprint 1

      Description

      Whilst writing testing instructions for MDL-63496 I have discovered that purpose and category inheritance do not work in the intended way.

      Where the purpose, or the category, are set to 'Inherit', this should inherit from the parent context.
      What is happening is that it is inheriting from the parent context type.
      Consider the following scenario:

      Purposes

      1. Example - retention period 5 years
      2. Some other - retention period 3 years
      3. Education - retention period 1 year

      Activity explicitly set to "Inherit"

      A site has a purpose set to "Example"
      A course category has a purpose set to "Some other"
      A course within it has a purpose set of "Education"
      A forum within that course is configured to "Inherit"

      Expected

      The forum is actively set to Inherit
      The forum will inherit from the course, and have an effective value of "Education" (1 year)

      Actual

      The forum inherits from the course, and has an effective value of "Education" (1 year)

      Activity instance not explicitly set

      A site has a purpose set to "Example"
      A course category has a purpose set to "Some other"
      A course within it has a purpose set of "Education"
      A forum within it has no purpose set
      The default for activity modules is set to "Inherit" (the default).

      Expected

      The forum will default receive the "Inherit" value from the activity module default.
      The forum will then inherit from the course, and have an effective value of "Education" (1 year)

      Actual

      The forum gains the "Inherit" value from the default for activity modules.
      The forum inherits from the the default for courses (Not set to "Inherit")
      The forum inherits from the the default for course categories (Not set to "Inherit")
      The forum inherits from the the default for the Site (Set to Example (5 years))

      Explanation

      When calculating the inheritance via the defaults system, we are looking up the context level tree rather than inheriting from the parent. i.e. we first check the forum itself, then fall back on the default for the context_module, then the default for context_course, then context_coursecat, and finally context_system.

      The "Inherit" option should behave identically in both scenarios.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Nov/18