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

Issue loading stylesheets when using YUI gallery treeview module

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.7
    • JavaScript
    • MOODLE_27_STABLE
    • Hide

      Add the following to the bottom of lib/javascript-static.js:

      YUI.applyConfig({
        modules: {}
      });
      

      Show
      Add the following to the bottom of lib/javascript-static.js: YUI.applyConfig({ modules: {} });

      I'm having some trouble getting the CSS to load when using the treeview module in a plugin.

      Steps to reproduce

      1. Install moodle/master
      2. Install my module from github.com/simoncoggins/moodle-tool_capexplorer/ (branch capexplorer-jsmodule-for-mdl-45606)
      3. Visit Admin > Users > Permissions > Capability explorer
      4. Notice the context treeview has circular bullet points and is not fully styled. Inspector shows the file:

      "[SITEURL]/theme/yui_combo.php?gallery/-1/skin-sam-gallery-sm-treeview/skin-sam-gallery-sm-treeview.js&3.15.0/template-micro/template-micro.js&3.15.0/tree-labelable/tree-labelable.js&3.15.0/tree-openable/tree-openable.js&3.15.0/tree-selectable/tree-selectable.js&3.15.0/view/view.js"
      

      is loaded. But looking in the file there is a line:

      // Combo resource gallery/-1/skin-sam-gallery-sm-treeview/skin-sam-gallery-sm-treeview.js ($CFG->dirroot/lib/yuilib/gallery/skin-sam-gallery-sm-treeview/skin-sam-gallery-sm-treeview.js) not found!
      

      This path is wrong - it shouldn't including 'skin-sam-'.

      5. Revert the commit 051548b897dd86bc5386e85c0e66a9fa888fde9d
      6. Reload the page
      7. Notice the context treeview has arrows and is fully styled. The inspector shows two separate files loaded:

      [SITEURL]/theme/yui_combo.php?3.15.0/template-micro/template-micro.js&3.15.0/tree-labelable/tree-labelable.js&3.15.0/tree-openable/tree-openable.js&3.15.0/tree-selectable/tree-selectable.js&3.15.0/view/view.js
      

      and

      "[SITEURL]/theme/yui_combo.php?gallery/-1/gallery-sm-treeview/assets/skins/sam/gallery-sm-treeview.css"
      

      The styles that were missing are found in the second (separate) file.

            Unassigned Unassigned
            simoncoggins Simon Coggins
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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