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

No 'fontsize' setting in Boost causes unit conflict

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.8.5, 3.9.2
    • 3.7.7, 3.8.4, 3.9.1, 3.10, 4.0
    • Themes
    • MOODLE_310_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • wip_MDL-69491_master
    • Hide

      Don't use the setting name 'fontsize' in a child theme or ensure it is an integer with the description stating that it is in 'rem' units.

      Show
      Don't use the setting name 'fontsize' in a child theme or ensure it is an integer with the description stating that it is in 'rem' units.
    • Hide
      1. Download and extract moo.zip.
      2. Open and follow the instructions contained in the Readme.md file to install the theme.
      3. Leave the default 'fontsize' setting value at '90%' when installing.
      4. Select the theme from within the UI.
      5. Purge all caches.
      6. Observe that no 'A non well formed numeric value encountered' error is in the PHP error log.
      Show
      Download and extract moo.zip. Open and follow the instructions contained in the Readme.md file to install the theme. Leave the default 'fontsize' setting value at '90%' when installing. Select the theme from within the UI. Purge all caches. Observe that no 'A non well formed numeric value encountered' error is in the PHP error log.

      In 'theme_boost_get_pre_scss' there is the code:

      $scss .= '$font-size-base: ' . (1 / 100 * $theme->settings->fontsize) . "rem !default;\n";

      which assumes that the 'fontsize' setting is in 'rem' units.  However:

      1. If a theme declares a setting of the same name (in effect to override the setting) with a non-numeric value then the error 'A non well formed numeric value encountered' happens when 'Purge all caches'.  This is because of the way that 'get_pre_scss_code' works in 'outputlib.php' and the child theme theme_config instance (referenced by $theme) is used with the Boost code 'theme_boost_get_pre_scss'.
      2. Boost has no 'fontsize' setting delaired in its 'settings.php'!

      Therefore this code is redundant and I propose it should be removed = its a bug!

      Code's been there since MDL-56511 with the string:

      $string['fontsize_desc'] = 'Enter a fontsize in %';

      stating percent and yet the code is 'rem'!  Thus a bug in MDL-56511.

       

       

        1. MDL-69491.jpg
          MDL-69491.jpg
          15 kB
        2. moo.zip
          19 kB

            gb2048 Gareth J Barnard
            gb2048 Gareth J Barnard
            Bas Brands Bas Brands
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 35 minutes
                1h 35m

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