Moodle

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

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Cannot Reproduce
  • Affects Version/s: 1.8.1
  • Fix Version/s: None
  • Component/s: AJAX
  • 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.

Issue Links

Activity

Hide
Urs Hunkler added a comment -

Might have a relation to MDL-10075?

Show
Urs Hunkler added a comment - Might have a relation to MDL-10075?
Hide
Tim Hunt added a comment -

I just tested, and I this is now working. (I think sam marshall fixed it at some point.)

Show
Tim Hunt added a comment - I just tested, and I this is now working. (I think sam marshall fixed it at some point.)

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: