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

    Details

    • Type: Bug
    • Status: Waiting for peer review
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.8, 3.8.5, 3.9.2, 4.0
    • Fix Version/s: None
    • Component/s: Themes
    • Labels:
    • Testing Instructions:
      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'.
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip_69982_master

      Description

      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.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gb2048 Gareth J Barnard
              Reporter:
              gb2048 Gareth J Barnard
              Participants:
              Component watchers:
              Bas Brands
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: