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

get_extra_scss_code: Order of scss is wrong (missing array_reverse)

XMLWordPrintable

    • MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-77657-401-get_extra_scss_code-wrong-order
    • MDL-77657-master-get_extra_scss_code-wrong-order
    • Hide
      1. Unzip the files boost_child.zip, boost_grandchild.zip and boost_greatgrandchild.zip into your theme/ directory.
      2. Install the three theme plugins.
      3. Set Moodle's design to theme_boost
      4. The site name header font color should be black. The button color should be blue. (Boost defaults)
      5. Set Moodle's design to theme_boost_child
      6. The site name header font color should be red. The button color should be red. (The plugin sets each in pre_scss and extra_scss respectively)
      7. Set Moodle's design to theme_boost_grandchild
      8. The site name header font color should be green. The button color should be green. (The plugin sets each in pre_scss and extra_scss respectively)
      9. Set Moodle's design to theme_boost_greatgrandchild
      10. The site name header font color should be green. The button color should be green. (The plugin should inherit scss rules from theme_boost_grandchild)
      Show
      Unzip the files boost_child.zip, boost_grandchild.zip and boost_greatgrandchild.zip into your theme/ directory. Install the three theme plugins. Set Moodle's design to theme_boost The site name header font color should be black. The button color should be blue. (Boost defaults) Set Moodle's design to theme_boost_child The site name header font color should be red. The button color should be red. (The plugin sets each in pre_scss and extra_scss respectively) Set Moodle's design to theme_boost_grandchild The site name header font color should be green. The button color should be green. (The plugin sets each in pre_scss and extra_scss respectively) Set Moodle's design to theme_boost_greatgrandchild The site name header font color should be green. The button color should be green. (The plugin should inherit scss rules from theme_boost_grandchild)

      In get_extra_scss_code and get_pre_scss_code (see https://github.com/moodle/moodle/blob/12a81769265a4fa75232ff1639423be1565c9fa9/lib/outputlib.php#L1591-L1612 and https://github.com/moodle/moodle/blob/12a81769265a4fa75232ff1639423be1565c9fa9/lib/outputlib.php#L1621-L1642), the theme ancestry is mixed up.

      If there are four themes (boost, boost_child, boost_grandchild and boost_greatgrandchild), each with its own method in extrascsscallback and prescsscallback{}, the resulting scss code in theme designer mode contains:

      /** Pre-SCSS from theme_boost_grandchild_get_pre_scss **/
      /** Pre-SCSS from theme_boost_child_get_pre_scss **/
      /** Pre-SCSS from theme_boost_get_pre_scss **/
      /** Pre-SCSS from theme_boost_greatgrandchild_get_pre_scss **/

      /** Extra SCSS from theme_boost_grandchild_get_extra_scss **/
      /** Extra SCSS from theme_boost_child_get_extra_scss **/
      /** Extra SCSS from theme_boost_get_extra_scss **/
      /** Extra SCSS from theme_boost_greatgrandchild_get_extra_scss **/

      This should probably rather be:

      /** Pre-SCSS from theme_boost_get_pre_scss **/
      /** Pre-SCSS from theme_boost_child_get_pre_scss **/
      /** Pre-SCSS from theme_boost_grandchild_get_pre_scss **/
      /** Pre-SCSS from theme_boost_greatgrandchild_get_pre_scss **/

      /** Extra SCSS from theme_boost_get_extra_scss **/
      /** Extra SCSS from theme_boost_child_get_extra_scss **/
      /** Extra SCSS from theme_boost_grandchild_get_extra_scss **/
      /** Extra SCSS from theme_boost_greatgrandchild_get_extra_scss **/

      The solution for this would probably be to change

              foreach ($this->parent_configs as $parent_config) {

      to

              foreach (array_reverse($this->parent_configs) as $parent_config) {

      .

        1. (I) Passed -- (Master)MDL-77657.png
          41 kB
          Kim Jared Lucas

            poggenpohlda Daniel Poggenpohl
            poggenpohlda Daniel Poggenpohl
            Glyn (Mathew) May Glyn (Mathew) May
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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