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

Theme layouts should inherit from parent theme

    • 3
    • C->HQ 2025 Sprint I2.2 Moppies

      Themes always load the base layouts (boost) and ignore the layouts in their parent theme if there is a sequence parent => child in the theme..

      The situation is  the following:

      • theme_parent inherit from boost but declares a new layout
      • theme_child inherit from parent and uses the new layout

      To reproduce:

      • Install the two themes attached to this ticket (parent and child)
      • Select child theme
      • Go to /theme/child/testnonstandard.php page
      • When the page is visited a debugging notice will be displayed that the layout doesn't exist.

       
       

      Invalid page layout specified: standardnonav
      line 2438 of /lib/outputlib.php: call to debugging() 
      line 2502 of /lib/outputlib.php: call to theme_config->layout_info_for_page() 
      line 1856 of /lib/pagelib.php: call to theme_config->setup_blocks() 
      line 1978 of /lib/setuplib.php: call to moodle_page->initialise_theme_and_output() 
      line 28 of /theme/child/testnonstandard.php: call to bootstrap_renderer->__call()
       
      

      As a side note, it seems to be a bit redundant to declare boost as a parent of the child theme, but if we do not do it, the child theme does not work (there is not transitive effect of the $THEME->parents).

      $THEME->parents = array(
          'parent',
          'boost',
      );

            laurent.david@moodle.com Laurent David
            david.saylor@moodle.com David Saylor
            Amaia Anabitarte Amaia Anabitarte
            Votes:
            5 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 24 minutes
                4h 24m

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