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

adding require_js to meta.php in a theme loads the rquested library twice.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.8.1
    • Fix Version/s: None
    • Component/s: JavaScript
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE

      Description

      What I have:

      The meta.php in the custom theme folder contains:
      (I added the echo statements around require_js for debugging)

      <?php echo ('<!-- include start -->');
      require_js($CFG->wwwroot.'/lib/mootools/mootools_comp.js');
      echo ('<!-- include end -->'); ?>

      <!--[if IE 7]>
      <link rel="stylesheet" type="text/css" href="<?php echo $CFG->httpswwwroot ?>/theme/textcampus/styles_ie7.css" />
      <![endif]-->
      <!--[if IE 6]>
      <link rel="stylesheet" type="text/css" href="<?php echo $CFG->httpswwwroot ?>/theme/textcampus/styles_ie6.css" />
      <link rel="stylesheet" media="all" type="text/css" href="<?php echo $CFG->wwwroot.'/theme/'.current_theme() ?>/basic_dd_ie.css" />
      <![endif]-->

      The correlating output in the Moodle page is:

      <!-- include start --><script type="text/javascript" src="http://moodle18.userver.lan/lib/mootools/mootools_comp.js"></script>
      <!-- include end -->
      <!--[if IE 7]>
      <link rel="stylesheet" type="text/css" href="http://moodle18.userver.lan/theme/textcampus/styles_ie7.css" />
      <![endif]-->
      <!--[if IE 6]>
      <link rel="stylesheet" type="text/css" href="http://moodle18.userver.lan/theme/textcampus/styles_ie6.css" />
      <link rel="stylesheet" media="all" type="text/css" href="http://moodle18.userver.lan/theme/textcampus/basic_dd_ie.css" />
      <![endif]-->
      <script type="text/javascript" src="http://moodle18.userver.lan/lib/mootools/mootools_comp.js"></script>

      The mootoolscomp.js library gets loaded twice.

      When I load the library with require_js from header.html all works well.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              urshunkler Urs Hunkler
              Tester:
              Nobody
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: