Details
Description
The openpopup function in /moodle/lib/javascript.php generate an error at next reference to windowobj object after window.open try.
If the popup blocker blocks the window.open no object esists so next call fails.
We can simply add
if (windowobj) {
after windowobj = window.open(fullurl,name,options);
and close the brachet before return false;
to solve it.
Cheers,
Roberto
Another possible Patch
Index: javascript.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/javascript.php,v
retrieving revision 1.36.2.3
diff -u -r1.36.2.3 javascript.php
— javascript.php 18 Jul 2008 07:14:12 -0000 1.36.2.3
+++ javascript.php 30 Mar 2009 16:28:12 -0000
@@ -34,13 +34,13 @@
<script type="text/javascript">
//<![CDATA[
function openpopup(url,name,options,fullscreen) {
+ var fullurl = "<?php echo $CFG->httpswwwroot ?>" + url;
+ var windowobj = window.open(fullurl,name,options);
+ if (fullscreen && windowobj) { windowobj.moveTo(0,0); windowobj.resizeTo(screen.availWidth,screen.availHeight); }
+ if(windowobj) windowobj.focus();
return false;
}