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

Calendar view.php doesn't get put through format_text() required for multilang language support

    Details

    • Testing Instructions:
      Hide

      Prerequisites:

      • Ensure that multilang filter is enabled.
      • The following assumes that your Moodle installation is setup to handle English and French language. You may need to change the languages in the strings to be inserted in order to accommodate the languages you have enabled on your test site.

      As an administrator:

      1. Add an event that would normally appear in the calendar.
      2. For the description, specify: <span lang="en" class="multilang">English</span><span lang="fr" class="multilang">French</span>
      3. View an event by clicking on a date in the calendar.
      4. If you only see English or French and not both, the filtering is working.
      5. In the navigation, click Home > Site Pages > Calendar
      6. In the URL, replace month with upcoming (sorry, I don't know how else to get there)
      7. If you only see English or French and not both in the event description, the filtering is working.
      Show
      Prerequisites: Ensure that multilang filter is enabled. The following assumes that your Moodle installation is setup to handle English and French language. You may need to change the languages in the strings to be inserted in order to accommodate the languages you have enabled on your test site. As an administrator: Add an event that would normally appear in the calendar. For the description, specify: <span lang="en" class="multilang">English</span><span lang="fr" class="multilang">French</span> View an event by clicking on a date in the calendar. If you only see English or French and not both, the filtering is working. In the navigation, click Home > Site Pages > Calendar In the URL, replace month with upcoming (sorry, I don't know how else to get there) If you only see English or French and not both in the event description, the filtering is working.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-41257-Calendar-Day-and-Upcoming-Events-View-not-processed-through-text-filters

      Description

      Although event titles are processed through the format_text() function, event descriptions in the Day and Upcoming Events views are not in the Moodle Calendar.

      I am working on a multilingual site which makes use of multilang. Without it, the description from every language is included when rendering the page.

      Recommendation

      Add the format_text function in a couple of places in the /calendar/view.php

      ==> Day view on line 127:

      echo $renderer->show_day($calendar);

      Replace with:

      echo format_text($renderer->show_day($calendar),true, false, false);

      ==> Upcoming Events view on line 144:

      echo $renderer->show_upcoming_events($calendar, $lookahead, $maxevents);

      Replace with:

      echo format_text($renderer->show_upcoming_events($calendar, $lookahead, $maxevents), true, false, false);

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Jan/14