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

Cohort description not available in mustache templates

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.5
    • Component/s: Cohorts
    • Labels:
    • Testing Instructions:
      Hide

      Set up

      1. Modify the mustache template to include description field:
        https://github.com/moodle/moodle/blob/master/admin/tool/lp/templates/form-cohort-selector-suggestion.mustache#L44. For instance, you can add it as a title on the name/idnumber spans (<span>name - description</span>)
      2. Clear cache
      3. Create at least a cohort and add a description
      4. Edit some of the roles (p.e. student), to add "User" as Context type

      Test

      1. Access to Site administration | Users | Permissions | Assign user roles to cohort (/admin/tool/cohortroles/)
      2. Check to see if description is being pulled through and shown on the cohort selector that uses the template (tool_cohortroles)
      Show
      Set up Modify the mustache template to include description field: https://github.com/moodle/moodle/blob/master/admin/tool/lp/templates/form-cohort-selector-suggestion.mustache#L44 . For instance, you can add it as a title on the name/idnumber spans (<span> name - description </span>) Clear cache Create at least a cohort and add a description Edit some of the roles (p.e. student), to add "User" as Context type Test Access to Site administration | Users | Permissions | Assign user roles to cohort (/admin/tool/cohortroles/) Check to see if description is being pulled through and shown on the cohort selector that uses the template (tool_cohortroles)
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      master_MDL-60979

      Description

      the mustache template states that it is an available option:
      https://github.com/moodle/moodle/blob/master/admin/tool/lp/templates/form-cohort-selector-suggestion.mustache#L40

      but when trying to use it you find that it is not available because description is missing in the cohort_summary_exporter class properties.

      https://github.com/moodle/moodle/blob/06e3b6d8bab42b8e56d169d006f31f4a15684830/cohort/classes/external/cohort_summary_exporter.php#L57.

      adding it to the list of properties makes it work.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/May/18