Moodle

front and course pages seem to have an error about YUI connection-min

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9.1
  • Component/s: AJAX
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

I get

"YAHOO.util.CustomEvent is not a constructor"

all over the place with

return false;})(),startEvent:new YAHOO.util.CustomEvent('start'),completeEvent:n...

on line 10 of connection-min.js as the culprit.

Activity

Hide
Johannes Albert added a comment -

It's a MAJOR ISSUE because this bug breaks the whole wiki-locking!
Reason: Someone forgot to load the YUI Event Library.
Fix: Add the following line to /moodle/mod/wiki/view.php#11:

require_js(array('yui_yahoo','yui_event'));

I suppose there are some more files affected, though course- and frontpage of my installation are ok.

Show
Johannes Albert added a comment - It's a MAJOR ISSUE because this bug breaks the whole wiki-locking! Reason: Someone forgot to load the YUI Event Library. Fix: Add the following line to /moodle/mod/wiki/view.php#11: require_js(array('yui_yahoo','yui_event')); I suppose there are some more files affected, though course- and frontpage of my installation are ok.
Hide
Mathieu Petit-Clair added a comment -

Thanks, I made the change in CVS. I searched through the files and the required libraries are included in other files (at least for yui_connection).

Show
Mathieu Petit-Clair added a comment - Thanks, I made the change in CVS. I searched through the files and the required libraries are included in other files (at least for yui_connection).
Hide
Matt Gibson added a comment -

I've still got this error despite having updated to the latest CVS. I see it on my main course pages.

Show
Matt Gibson added a comment - I've still got this error despite having updated to the latest CVS. I see it on my main course pages.
Hide
Matt Gibson added a comment -

Using custom corners theme BTW

Show
Matt Gibson added a comment - Using custom corners theme BTW
Hide
Mathieu Petit-Clair added a comment -

I can't reproduce this... can you export the course and send it to me, by private email, or tell me a bit more about your setup (which blocks, modules, etc. are active)?

Show
Mathieu Petit-Clair added a comment - I can't reproduce this... can you export the course and send it to me, by private email, or tell me a bit more about your setup (which blocks, modules, etc. are active)?
Hide
Matt Gibson added a comment -

I seem to have a link to conection-min.js at the top of the recent activity block. The error originates on line 10 of that file and the recent activity block is the only bit that calls it.

Show
Matt Gibson added a comment - I seem to have a link to conection-min.js at the top of the recent activity block. The error originates on line 10 of that file and the recent activity block is the only bit that calls it.
Hide
Matt Gibson added a comment -

I think it just needs to have event-min.js included, which is where that constructor lives.

Show
Matt Gibson added a comment - I think it just needs to have event-min.js included, which is where that constructor lives.
Hide
Mathieu Petit-Clair added a comment -

Hmm.. can you give me more details on how to reproduce this? The only file where there is yui_yahoo and not yui_event is group/index.php. Can I see the error on a live site?

Thanks,

Show
Mathieu Petit-Clair added a comment - Hmm.. can you give me more details on how to reproduce this? The only file where there is yui_yahoo and not yui_event is group/index.php. Can I see the error on a live site? Thanks,
Hide
Mathieu Petit-Clair added a comment -

The recent_activity block doesn't use or call any yui_* files. Can you paste the exact error you have, along with the exact build version (see in /version.php) you are using? As I can't reproduce this, seeing the error on a live site would be the next best thing (unless you can send me a db dump from which I could reproduce the error).

Show
Mathieu Petit-Clair added a comment - The recent_activity block doesn't use or call any yui_* files. Can you paste the exact error you have, along with the exact build version (see in /version.php) you are using? As I can't reproduce this, seeing the error on a live site would be the next best thing (unless you can send me a db dump from which I could reproduce the error).
Hide
Matt Gibson added a comment -

Hi Mat, I've emailed you a login on your moodle.com address.

The error is (according to Firebug):

YAHOO.util.CustomEvent is not a constructor
[Break on this error] return false;})(),startEvent:new YAHOO.util.CustomEvent('start'),completeEvent:n...

The guilty source code from the course page seems to be:

elementCookieHide("inst957","Show Calendar block","Hide Calendar block");
//]]>

</script><span id="sb-8" class="skip-block-to"></span><a href="#sb-9" class="skip-block">Skip Recent Activity</a><div id="inst937" class="block_recent_activity sideblock"><div class="wrap">
<div class="header"><div class="bt"><div> </div></div><div class="i1"><div class="i2"><div class="i3"><div class="title"><input type="image" src="http://mymoodle.com/pix/smartpix.php/pen_and_ink_7/t/switch_minus.gif" id="togglehide_inst937" onclick="elementToggleHide(this, true, function(el) {return findParentNode(el, 'DIV', 'sideblock'); }, 'Show Recent Activity block', 'Hide Recent Activity block'); return false;" alt="Hide Recent Activity block" title="Hide Recent Activity block" class="hide-show-image" /><h2>Recent Activity</h2></div></div></div></div></div><div class="i1"><div class="i2"><div class="i3"><div class="content"><div class="activitydate">Activity since Monday, 21 April 2008, 12:39 PM</div><div class="activityhead"><a href="http://mymoodle.com/course/recent.php?id=58">Full report of recent activity...</a></div>
<script type="text/javascript" src="http://mymoodle.com/lib/yui/yahoo/yahoo-min.js"></script>
<script type="text/javascript" src="http://mymoodle.com/lib/yui/connection/connection-min.js"></script>
<h2 class="1">Assignments submitted:</h2><div class="head"><div class="date"> 21 Apr, 12:49</div><div class="name">Student One</div></div><div class="info"><a href="http://mymoodle.com/mod/assignment/view.php?id=1869">Final project submission</a></div><div class="head"><div class="date"> 21 Apr, 14:44</div><div class="name">Student Two</div></div><div class="info"><a href="http://mymoodle.com/mod/assignment/view.php?id=1893">Project brief submission (12 marks)</a></div></div></div></div></div><div class="bb"><div> </div></div></div></div><script type="text/javascript">
//<![CDATA[
elementCookieHide("inst937","Show Recent Activity block","Hide Recent Activity block");
//]]>

</script><span id="sb-9" class="skip-block-to"></span></div></div></div>
<div class="bb"><div> </div></div>
</div></td></tr></table></div>

Show
Matt Gibson added a comment - Hi Mat, I've emailed you a login on your moodle.com address. The error is (according to Firebug): YAHOO.util.CustomEvent is not a constructor [Break on this error] return false;})(),startEvent:new YAHOO.util.CustomEvent('start'),completeEvent:n... The guilty source code from the course page seems to be: elementCookieHide("inst957","Show Calendar block","Hide Calendar block"); //]]> </script><span id="sb-8" class="skip-block-to"></span><a href="#sb-9" class="skip-block">Skip Recent Activity</a><div id="inst937" class="block_recent_activity sideblock"><div class="wrap"> <div class="header"><div class="bt"><div> </div></div><div class="i1"><div class="i2"><div class="i3"><div class="title"><input type="image" src="http://mymoodle.com/pix/smartpix.php/pen_and_ink_7/t/switch_minus.gif" id="togglehide_inst937" onclick="elementToggleHide(this, true, function(el) {return findParentNode(el, 'DIV', 'sideblock'); }, 'Show Recent Activity block', 'Hide Recent Activity block'); return false;" alt="Hide Recent Activity block" title="Hide Recent Activity block" class="hide-show-image" /><h2>Recent Activity</h2></div></div></div></div></div><div class="i1"><div class="i2"><div class="i3"><div class="content"><div class="activitydate">Activity since Monday, 21 April 2008, 12:39 PM</div><div class="activityhead"><a href="http://mymoodle.com/course/recent.php?id=58">Full report of recent activity...</a></div> <script type="text/javascript" src="http://mymoodle.com/lib/yui/yahoo/yahoo-min.js"></script> <script type="text/javascript" src="http://mymoodle.com/lib/yui/connection/connection-min.js"></script> <h2 class="1">Assignments submitted:</h2><div class="head"><div class="date"> 21 Apr, 12:49</div><div class="name">Student One</div></div><div class="info"><a href="http://mymoodle.com/mod/assignment/view.php?id=1869">Final project submission</a></div><div class="head"><div class="date"> 21 Apr, 14:44</div><div class="name">Student Two</div></div><div class="info"><a href="http://mymoodle.com/mod/assignment/view.php?id=1893">Project brief submission (12 marks)</a></div></div></div></div></div><div class="bb"><div> </div></div></div></div><script type="text/javascript"> //<![CDATA[ elementCookieHide("inst937","Show Recent Activity block","Hide Recent Activity block"); //]]> </script><span id="sb-9" class="skip-block-to"></span></div></div></div> <div class="bb"><div> </div></div> </div></td></tr></table></div>
Hide
Mathieu Petit-Clair added a comment -

Matt, I had a look at the site and I get the error too... but it doesn't make any sense. I happens at a place where there is no code from YUI getting called or used. Are you using non-core modules, or did you add something that cause this to your theme?

Technically, this block is created by the function print_recent_activty, in /course/lib.php. Each module gets a chance to print it's stuff, around line 936. But Assignment (seems to be) the first module to be called. No core module outputs any yui-related code. I checked out the version you are using (from last week) and there is no difference there.

So.. are you using any other non-core module?

Really nice site, btw!

Show
Mathieu Petit-Clair added a comment - Matt, I had a look at the site and I get the error too... but it doesn't make any sense. I happens at a place where there is no code from YUI getting called or used. Are you using non-core modules, or did you add something that cause this to your theme? Technically, this block is created by the function print_recent_activty, in /course/lib.php. Each module gets a chance to print it's stuff, around line 936. But Assignment (seems to be) the first module to be called. No core module outputs any yui-related code. I checked out the version you are using (from last week) and there is no difference there. So.. are you using any other non-core module? Really nice site, btw!
Hide
Mathieu Petit-Clair added a comment -

Hmm.. it looks like you are using nwiki. When did you last update it?

Show
Mathieu Petit-Clair added a comment - Hmm.. it looks like you are using nwiki. When did you last update it?
Hide
Eloy Lafuente (stronk7) added a comment -

Reviewing this... has been anything fixed or perhaps the correct status should be "not a bug" or similar. Mathieu?

Show
Eloy Lafuente (stronk7) added a comment - Reviewing this... has been anything fixed or perhaps the correct status should be "not a bug" or similar. Mathieu?
Hide
Mathieu Petit-Clair added a comment -

Yeah, there was a bug, and it was fixed in mid-March. The rest is a different issue, it appears.

Show
Mathieu Petit-Clair added a comment - Yeah, there was a bug, and it was fixed in mid-March. The rest is a different issue, it appears.
Hide
Matt Gibson added a comment -

Oops, forgot to comment that it was fixed by upgrading nwiki.

Show
Matt Gibson added a comment - Oops, forgot to comment that it was fixed by upgrading nwiki.
Hide
Mathieu Petit-Clair added a comment -

Good to know, thanks for this update. Now we can truly close this.

Show
Mathieu Petit-Clair added a comment - Good to know, thanks for this update. Now we can truly close this.
Hide
Eloy Lafuente (stronk7) added a comment -

Closing as requested. Thanks!

Show
Eloy Lafuente (stronk7) added a comment - Closing as requested. Thanks!

Dates

  • Created:
    Updated:
    Resolved: