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

get_pre_scss_code does not apply parent theme setting when a child theme is set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Minor Minor
    • None
    • 3.7.8, 3.8.5, 3.9.2, 4.0
    • Themes
    • MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • wip_69982_master
    • Hide
      1. Install attached simple 'Moo' child theme of 'Boost'.
      2. Select the 'Boost' theme.
      3. In the 'theme_boost | scsspre' setting set the value:
      4. $pink: #fab;
        $headings-color: $pink;
      5. Observe that the headings are now 'pink' i.e. #fab.
      6. Select the 'Moo' theme.
      7. Observe that the headings are still 'pink'.
      Show
      Install attached simple 'Moo' child theme of 'Boost'. Select the 'Boost' theme. In the 'theme_boost | scsspre' setting set the value: $pink: #fab; $headings-color: $pink; Observe that the headings are now 'pink' i.e. #fab. Select the 'Moo' theme. Observe that the headings are still 'pink'.

      If you set the a setting in a parent theme that is not overridden in the child theme and that setting is used by the 'theme_boost_get_extra_scss' Boost callback which has been invoked by the method 'get_pre_scss_code' of the 'theme_config' class in '/lib/outputlib.php' then it is not used by the child theme because the SCSS is generated with the settings of the child and not the parent.  This is down to two reasons:

      • 'get_pre_scss_code' calls the function 'theme_boost_get_extra_scss' in Boost's lib.php via the '$THEME->prescsscallback' setting in Boost's config.php file using the 'theme_config' object of the child and not the parent.
      • and if that is rectified, then the 'parent_configs' -> 'setttings' attribute has the settings of the child theme and not the actual theme that the 'parent_config' (theme_config object) belongs to.

       

        1. MDL_69982_class_diagram_2.png
          MDL_69982_class_diagram_2.png
          133 kB
        2. MDL_69982_class_diagram.png
          MDL_69982_class_diagram.png
          57 kB
        3. moo.zip
          18 kB
        4. Screenshot 2021-09-02 161145.png
          Screenshot 2021-09-02 161145.png
          43 kB
        5. Screenshot 2021-09-02 161312.png
          Screenshot 2021-09-02 161312.png
          41 kB

            gb2048 Gareth J Barnard
            gb2048 Gareth J Barnard
            Bas Brands Bas Brands
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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