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

Avoid including the renderer.php in get_renderer method

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.0, 4.1
    • Themes
    • MOODLE_400_STABLE, MOODLE_401_STABLE

      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.

            Unassigned Unassigned
            tusefomal Ferran Recio
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.