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

Avoid including the renderer.php in get_renderer method



    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.0, 4.1
    • None
    • Other, Themes


      Scenario: components and plugins renderers should be moved to proper namespace classes (XXX\output\renderer). However, someitmes the old renderer.php files cannot be removed from core because contrib plugins still include them in their code (a typical example is course/format/topics/renderer.php to extend the topics format).

      Problem: following the deprecation process, the old renderer.php files should have a debugging message to alert the plugins they need to remove the inclusion. However, the current $page->get_renderer method checks if the file is present and to a require_once even if the output class is available. This means that we cannot add the deprecation message because it will appear every time the rendered is create via get_renderer (which is the proper way of doing it).

      Extra task: this issue is discovered while integrating MDL-72578. One of the tasks of this issue is also add a deprecation message to the following legacy renderers:

      • course/format/renderer.php
      • course/format/topics/renderer.php
      • course/format/weeks/renderer.php

      Technical details: the method that does the require_once is standard_renderer_classnames.

      Solution hint: the get_renderer method should check first if the namespace renderer exists and, if not, continue with the regular way of finding the correct renderer testing the several names and locations options. In fact, at some moment this "regular way" of testing multiple renderer formats should disappear and we should be more strict in the way renderers are implemented.


        Issue Links



              Unassigned Unassigned
              tusefomal Ferran Recio
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan, Huong Nguyen, Bas Brands, Mathew May
              0 Vote for this issue
              2 Start watching this issue