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

Block docking not using FontAwesome when set by the theme.

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.3
    • Fix Version/s: None
    • Component/s: Blocks
    • Labels:
      None
    • Testing Instructions:
      Hide
      1. Edit the Clean theme config.php file and add '$THEME->iconsystem = \core\output\icon_system::FONTAWESOME;' at the bottom.
      2. Purge all caches.
      3. Login as an administrator.
      4. Navigate to the Dashboard.
      5. On the 'Administration' block observe the use of the FontAwesome fa-caret-square-o-left icon for block to dock.
      6. Repeat for single and all undocking.
      Show
      Edit the Clean theme config.php file and add '$THEME->iconsystem = \core\output\icon_system::FONTAWESOME;' at the bottom. Purge all caches. Login as an administrator. Navigate to the Dashboard. On the 'Administration' block observe the use of the FontAwesome fa-caret-square-o-left icon for block to dock. Repeat for single and all undocking.
    • Workaround:
      Hide

      None.

      Show
      None.
    • Affected Branches:
      MOODLE_33_STABLE

      Description

      In -MDL-40759- FontAwesome was added as an icon system to be used by a theme if desired.  The title of the issue is 'Use the Font Awesome icon font for all icons in Moodle' however the function 'M.core.dock.ensureMoveToIconExists' in '/lib/yui/src/dock/js/loader.js':

      {code}

      M.core.dock.ensureMoveToIconExists = function(blocknode) {
      if (blocknode.one('.moveto')) {
      return true;
      }

      var commands,
      moveto = Y.Node.create('<input type="image" class="moveto customcommand requiresjs" />'),
      blockaction = blocknode.one('.block_action'),
      icon = 't/block_to_dock',
      titleh2 = blocknode.one('.header .title h2');

      // Must set the image src separately of we get an error with XML strict headers
      if (Y.one(document.body).hasClass('dir-rtl')) {
      icon = icon + '_rtl';
      }
      moveto.setAttribute('alt', M.util.get_string('addtodock', 'block'));
      if (titleh2) {
      moveto.setAttribute('title', Y.Escape.html(M.util.get_string('dockblock', 'block', titleh2.getHTML())));
      }
      moveto.setAttribute('src', M.util.image_url(icon, 'moodle'));

      .....

      {code}

      ignores this and injects an image directly rather than implementing the intent of the theme configuration setting: $THEME->iconsystem = \core\output\icon_system::FONTAWESOME;

      Therefore 'Use the Font Awesome icon font for all icons in Moodle' is false and incomplete.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  4 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated: