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

Review usage of get_renderer

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.2.2
    • Fix Version/s: None
    • Component/s: Themes
    • Labels:
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_32_STABLE

      Description

      While working on MDL-57510. I realized that -
      If I create \theme_boost\output\core_question_renderer, everything works as expected. But \theme_boost\output\core\question_renderer doesn't work (default renderer gets called instead)

      This was happening because I was calling $PAGE->get_renderer("core_question") instead of get_renderer("core", "question")
      Look at lib/outputfactories.php, theme_overridden_renderer_factory, to know why it makes a difference.

      Upon looking at other usages I found that core_message is used both ways in core. All usages needs to be made consistent and properly documented to avoid issues like this for themers.

      Cheers

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ankit_frenz Ankit Agarwal
            Participants:
            Component watchers:
            Huong Nguyen, Bas Brands, Mathew May
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: