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

Allow contexts to be passed into external format functions

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test

      1. Log in as admin
      2. Turn on multi-lang filter for content and heading
        • site administration > plugins > filters > manager filters
      3. Create a course with a multi-lang full name and short name
        • E.g. full name <span lang="en" class="multilang">Course 1</span><span lang="fr" class="multilang">FR</span>
        • short name <span lang="en" class="multilang">C1</span><span lang="fr" class="multilang">FR</span>
      4. View the course and click on “Calendar” in the nav drawer to go to the course calendar
      5. Create a new event for the course and set a multi-lang string for the event title and some HTML content for the description
        • E.g. event title <span lang="en" class="multilang">Event title</span><span lang="fr" class="multilang">FR</span>
        • Description click on the down arrow (top left) to show more option in the atto toolbar and turn on HTML mode (bottom right) and past something like

          <h4>Heading</h4>
          <p>This is some <strong>bold</strong> text.</p>

      6. CONFIRM that the event is created
      7. Click on the event to open the summary modal
      8. CONFIRM that the event title only shows the English string (assuming your site language is in English)
      9. CONFIRM that the course name only shows the English string
      10. CONFIRM that the description is rendered correctly with the heading and the bolded text.
      Show
      Test Log in as admin Turn on multi-lang filter for content and heading site administration > plugins > filters > manager filters Create a course with a multi-lang full name and short name E.g. full name <span lang="en" class="multilang">Course 1</span><span lang="fr" class="multilang">FR</span> short name <span lang="en" class="multilang">C1</span><span lang="fr" class="multilang">FR</span> View the course and click on “Calendar” in the nav drawer to go to the course calendar Create a new event for the course and set a multi-lang string for the event title and some HTML content for the description E.g. event title <span lang="en" class="multilang">Event title</span><span lang="fr" class="multilang">FR</span> Description click on the down arrow (top left) to show more option in the atto toolbar and turn on HTML mode (bottom right) and past something like <h4>Heading</h4> <p>This is some <strong>bold</strong> text.</p> CONFIRM that the event is created Click on the event to open the summary modal CONFIRM that the event title only shows the English string (assuming your site language is in English) CONFIRM that the course name only shows the English string CONFIRM that the description is rendered correctly with the heading and the bolded text.
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-60966-master

      Description

      The external format functions currently only take contexts by id and will then load the context within the function. This potentially adds an additional DB read if we've already loaded the context because we can't just simply pass it in.

      Instead the functions should take the id (for backwards compatibility) and the context itself. It can then load the context only if one isn't provided.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ryanwyllie Ryan Wyllie
              Reporter:
              ryanwyllie Ryan Wyllie
              Peer reviewer:
              Jake Dallimore
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Rayna Mae Jayco
              Participants:
              Component watchers:
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

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