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

CSS filter does not apply to monologo icons added in themes.

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_404_STABLE
    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MDL-82740-403
    • MDL-82740-404
    • MDL-82740-main
    • Hide
      1. Download the test patches and apply them to your moodle instance.
        • 404 and main: MDL-82740-TEST-COMMIT-404.patch

          git am -3 path/to/MDL-82740-TEST-COMMIT-404.patch
          

        • 403: MDL-82740-TEST-COMMIT-403.patch

          git am -3 path/to/MDL-82740-TEST-COMMIT-403.patch
          

        • This test patch:
          • Overrides the monologo icons for the Book activity in the Classic and Boost themes.
          • Removes the monologo icons for the Book activity in order to make sure that the correct icon style is being applied for the overridden icons.
      2. Purge caches.
      3. Make sure you're using the Boost theme.
      4. Go to a course. Turn editing mode on and click "Add an activity or resource."
      5. On the activity chooser dialogue, confirm that the Book activity shows a whitened icon. (Without the patch, the icon will be displayed as a coloured icon)
      6. Switch to the Classic theme.
      7. Open the activity chooser again and confirm that the Book activity shows a whitened icon. (Without the patch, the icon will be displayed as a coloured icon)
      After test
      • Make sure to revert the change. If using MDK, just run "mdk update". Or using git, "git checkout origin/[BRANCH_NAME]"
      Show
      Download the test patches and apply them to your moodle instance. 404 and main: MDL-82740-TEST-COMMIT-404.patch git am -3 path /to/MDL-82740-TEST-COMMIT-404 .patch 403: MDL-82740-TEST-COMMIT-403.patch git am -3 path /to/MDL-82740-TEST-COMMIT-403 .patch This test patch: Overrides the monologo icons for the Book activity in the Classic and Boost themes. Removes the monologo icons for the Book activity in order to make sure that the correct icon style is being applied for the overridden icons. Purge caches. Make sure you're using the Boost theme. Go to a course. Turn editing mode on and click "Add an activity or resource." On the activity chooser dialogue, confirm that the Book activity shows a whitened icon. (Without the patch, the icon will be displayed as a coloured icon) Switch to the Classic theme. Open the activity chooser again and confirm that the Book activity shows a whitened icon. (Without the patch, the icon will be displayed as a coloured icon) After test Make sure to revert the change. If using MDK, just run " mdk update ". Or using git, " git checkout origin/ [BRANCH_NAME] "

      In moodle we can override icons by putting them in corresponding directories in a theme.
      https://moodledev.io/docs/4.5/apis/plugintypes/theme/images#override-images

      There is a method has_monologo_icon in /lib/classes/component.php
      The method does not take into account the presence of monologo icons in the active theme.

      This method is used in methods:
      find_all_for_course in /lib/classes/component.php (4.1) or /course/classes/local/repository/content_item_readonly_repository.php (4.4)
      get_icon_url in /lib/modinfolib.php

      As a result, the icons get the 'nofilter' class or misses the 'filtericon' parameter, and even if there are corresponding monologo icons in the theme, the CSS filter is not applied to them.

       

      The CSS filter should work for monologo icons added in the active theme.

       

      Might be related to https://tracker.moodle.org/browse/MDL-81938 seems like something else though.

            jpataleta Jun Pataleta
            андрейусков Андрей Усков
            Mikel Martín Corrales Mikel Martín Corrales
            Ferran Recio Ferran Recio
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            1 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 50 minutes
                3h 50m

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