Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.4
    • Component/s: Unknown
    • Environment:
      Lenux/Apache with Moodle 2.0 (Build: 20101214)
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      Set an existing html-file into the configuration "sitepolicy". So the sitepolicy agreement is active.
      Open your moodle in the IE e.g. 8
      Login with an account who has not agreed the policy already.
      Click on any resource so the policy.php is open.
      The object-part from this page is blank.

      Show
      Set an existing html-file into the configuration "sitepolicy". So the sitepolicy agreement is active. Open your moodle in the IE e.g. 8 Login with an account who has not agreed the policy already. Click on any resource so the policy.php is open. The object-part from this page is blank.
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-25775_head

      Description

      I set the system to require use of a Terms of Use Agreement. The URL for the agreement is correct. It works when you create a new account.

      If you manually create a new user and enroll him in a course, he is expected to agree to the terms on login.
      But the terms of use agreement does not load. There is only a blank page.

      You can see this problem at http://www.musapp.com/Cm2Pm
      username= teststudent2
      password= 4Student2*

      If you click that you agree to the "Blank Page", the terms of use agreement does not trigger the next time you login.

      Thanks,
      Clarence

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Helen Foster added a comment -

            Hi Clarence,

            Just wondering whether you're using IE to view the site policy? It displays fine for me (using Firefox).

            According to http://docs.moodle.org/en/Site_policies#Site_policy_URL

            It is recommended that the site policy is on the same domain as Moodle to avoid the problem of Internet Explorer users seeing a blank screen when the site policy is on a different domain.

            Hope this helps solve your problem.

            Show
            Helen Foster added a comment - Hi Clarence, Just wondering whether you're using IE to view the site policy? It displays fine for me (using Firefox). According to http://docs.moodle.org/en/Site_policies#Site_policy_URL It is recommended that the site policy is on the same domain as Moodle to avoid the problem of Internet Explorer users seeing a blank screen when the site policy is on a different domain. Hope this helps solve your problem.
            Hide
            Clarence Prudhoe added a comment -

            Hi Helen,

            Yes, I am using IE-8

            And yes, the Site Policy is located on the same domain.

            The site policy is at http://www.musapp.com/terms.html

            The login page is at http://www.musapp.com/Cm2Pm/login/index.php

            The terms.html works when it is call from the New Account form, but it fails if you create the new user account manually as the Admin. Makes me think there is a bug on the page that calls the Site Policy from the login page.

            Thanks,
            Clarence

            Show
            Clarence Prudhoe added a comment - Hi Helen, Yes, I am using IE-8 And yes, the Site Policy is located on the same domain. The site policy is at http://www.musapp.com/terms.html The login page is at http://www.musapp.com/Cm2Pm/login/index.php The terms.html works when it is call from the New Account form, but it fails if you create the new user account manually as the Admin. Makes me think there is a bug on the page that calls the Site Policy from the login page. Thanks, Clarence
            Hide
            Clarence Prudhoe added a comment -

            Hello,

            I believe the problem is in moodle/lib/resourcelib.php line 458

            function resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype)

            The problem is that IE doesn't like the object tag.

            Since all of my users will be using IE (we are using an embedded IE in our application), I effected a temporary fix as follows:

            In moodle/lib/resourcelib.php line 461 I changed $iframe = false; TO $iframe = true;

            Now when Moodle tries to embed a page, it will always use an iframe instead of the object tag. I just have to remember to change this when I update Moodle 2.0.

            I hope someone can figure out a better fix for this problem.

            Thanks,
            Clarence

            Show
            Clarence Prudhoe added a comment - Hello, I believe the problem is in moodle/lib/resourcelib.php line 458 function resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype) The problem is that IE doesn't like the object tag. Since all of my users will be using IE (we are using an embedded IE in our application), I effected a temporary fix as follows: In moodle/lib/resourcelib.php line 461 I changed $iframe = false; TO $iframe = true; Now when Moodle tries to embed a page, it will always use an iframe instead of the object tag. I just have to remember to change this when I update Moodle 2.0. I hope someone can figure out a better fix for this problem. Thanks, Clarence
            Hide
            Helen Foster added a comment -

            Increasing priority as more people are reporting this problem http://moodle.org/mod/forum/discuss.php?d=164074

            Show
            Helen Foster added a comment - Increasing priority as more people are reporting this problem http://moodle.org/mod/forum/discuss.php?d=164074
            Hide
            Dušan Ristić added a comment -

            as I've mentioned in post http://moodle.org/mod/forum/discuss.php?d=164074#p719153 removing param tag few lines below line 472 in moodle/lib/resourcelib.php seems to solve the problem with IE

            <object id="resourceobject" data="$fullurl" type="$mimetype">
            <param name="src" value="$fullurl" />

            Show
            Dušan Ristić added a comment - as I've mentioned in post http://moodle.org/mod/forum/discuss.php?d=164074#p719153 removing param tag few lines below line 472 in moodle/lib/resourcelib.php seems to solve the problem with IE <object id="resourceobject" data="$fullurl" type="$mimetype"> <param name="src" value="$fullurl" />
            Hide
            Gisele Brugger added a comment -

            Hello all,

            I had the same problelm with IE ( firefox, crhome its OK )

            I resolved according to instructions the Clarence Prudhoe.
            only change :

            In moodle/lib/resourcelib.php line 461 I changed $iframe = false; TO $iframe = true;

            only this and resolved.

            Thanks a lot

            Show
            Gisele Brugger added a comment - Hello all, I had the same problelm with IE ( firefox, crhome its OK ) I resolved according to instructions the Clarence Prudhoe. only change : In moodle/lib/resourcelib.php line 461 I changed $iframe = false; TO $iframe = true; only this and resolved. Thanks a lot
            Hide
            Gisele Brugger added a comment -

            Other situation :

            Iframe the sitepolicy iframe not open to the chosen theme simpleSpace

            see the solucion : http://moodle.org/mod/forum/discuss.php?d=168488#p739161

            Show
            Gisele Brugger added a comment - Other situation : Iframe the sitepolicy iframe not open to the chosen theme simpleSpace see the solucion : http://moodle.org/mod/forum/discuss.php?d=168488#p739161
            Hide
            Diane Villemure added a comment -

            I have Moodle version 2.0.1+ (Built 20110125). I created all user accounts manually as the Admin. I am using formal_white as my theme. My site policy (an .html file at the root of the moodle domain) is not displaying in any browser I've tried (e.g., IE 8, Firefox 3 nor Opera 11). I changed $iframe = false; TO $iframe = true; in moodle/lib/resourcelib.php line 461 but it didn't make a difference. I substituted John St's "general.php" patch (see http://moodle.org/mod/forum/discuss.php?d=168488#p739161) in /theme/formal_white/layout but it only corrupted the layout. I removed <param name="src" value="$fullurl" /> on line 485 of moodle/lib/resourcelib.php but it didn't make any difference.

            Show
            Diane Villemure added a comment - I have Moodle version 2.0.1+ (Built 20110125). I created all user accounts manually as the Admin. I am using formal_white as my theme. My site policy (an .html file at the root of the moodle domain) is not displaying in any browser I've tried (e.g., IE 8, Firefox 3 nor Opera 11). I changed $iframe = false; TO $iframe = true; in moodle/lib/resourcelib.php line 461 but it didn't make a difference. I substituted John St's "general.php" patch (see http://moodle.org/mod/forum/discuss.php?d=168488#p739161 ) in /theme/formal_white/layout but it only corrupted the layout. I removed <param name="src" value="$fullurl" /> on line 485 of moodle/lib/resourcelib.php but it didn't make any difference.
            Hide
            Gisele Brugger added a comment -

            Hello Diane,
            I tested in Formal white theme and IFRAME not opened. Formal white have problem to open IFRAME.
            Please, test in FormFactor theme and see if it works.
            In my case, simple space theme (http://moodle.org/mod/data/view.php?d=26&rid=3985&filter=1) the problem was in file general.php and John St resolved. Read the comments put on the forum. The problem of zero height. http://moodle.org/mod/forum/discuss.php?d=168488#p739161
            see the pictures whith source code

            Show
            Gisele Brugger added a comment - Hello Diane, I tested in Formal white theme and IFRAME not opened. Formal white have problem to open IFRAME. Please, test in FormFactor theme and see if it works. In my case, simple space theme ( http://moodle.org/mod/data/view.php?d=26&rid=3985&filter=1 ) the problem was in file general.php and John St resolved. Read the comments put on the forum. The problem of zero height. http://moodle.org/mod/forum/discuss.php?d=168488#p739161 see the pictures whith source code
            Hide
            Diane Villemure added a comment -

            Gisele, you are right! I changed the theme to use the Standard theme (the default one in a fresh install of Moodle). The site policy file loaded in Opera and FireFox but not in IE. So I changed $iframe = false; TO $iframe = true; in moodle/lib/resourcelib.php line 461 and then the site policy file loaded in all 3 browsers. What this means to me is that the issue is NOT that I created all user accounts manually as the Admin but that stock theme "Formal White"

            Show
            Diane Villemure added a comment - Gisele, you are right! I changed the theme to use the Standard theme (the default one in a fresh install of Moodle). The site policy file loaded in Opera and FireFox but not in IE. So I changed $iframe = false; TO $iframe = true; in moodle/lib/resourcelib.php line 461 and then the site policy file loaded in all 3 browsers. What this means to me is that the issue is NOT that I created all user accounts manually as the Admin but that stock theme "Formal White"
            Hide
            Diane Villemure added a comment -

            As John St remarked in http://moodle.org/mod/forum/discuss.php?d=168488#p739161,

            "The iframe width and height is calculated via the yui javascript, and for some reason, the elements #page-header and #page-footer need to be in place or else this javascript measuring fails."

            This could be pointing in the right direction to fix this bug. That and changing $iframe = false; TO $iframe = true; in moodle/lib/resourcelib.php line 461

            I can't change the theme at this point because this look & feel is what the client wants. So I'm hoping that a fix for the Formal White theme will be available soon.

            Show
            Diane Villemure added a comment - As John St remarked in http://moodle.org/mod/forum/discuss.php?d=168488#p739161 , "The iframe width and height is calculated via the yui javascript, and for some reason, the elements #page-header and #page-footer need to be in place or else this javascript measuring fails." This could be pointing in the right direction to fix this bug. That and changing $iframe = false; TO $iframe = true; in moodle/lib/resourcelib.php line 461 I can't change the theme at this point because this look & feel is what the client wants. So I'm hoping that a fix for the Formal White theme will be available soon.
            Hide
            John Stabinger added a comment -

            Yes, this seems to be the same bug that Gisele found in a non-core theme. In essence, the iframe height seems to be calculated via the yui javascript, and for some reason, the elements #page-header and #page-footer need to be in place or else this javascript measuring fails (maybe it does the measurements based off this?).

            And, if you look in the formal white layout file, general.php, you will see that it has no #page=header element... So, simply adding an empty #page-header element in the header fixes the issue. Although I would argue that it the iframe height measurement should be based off of something else other than these two elements.

            I added #page-header right after header-home, like so:

            <div id="header-home" class="clearfix"><div id="page-header"></div>

            Show
            John Stabinger added a comment - Yes, this seems to be the same bug that Gisele found in a non-core theme. In essence, the iframe height seems to be calculated via the yui javascript, and for some reason, the elements #page-header and #page-footer need to be in place or else this javascript measuring fails (maybe it does the measurements based off this?). And, if you look in the formal white layout file, general.php, you will see that it has no #page=header element... So, simply adding an empty #page-header element in the header fixes the issue. Although I would argue that it the iframe height measurement should be based off of something else other than these two elements. I added #page-header right after header-home, like so: <div id="header-home" class="clearfix"><div id="page-header"></div>
            Hide
            Diane Villemure added a comment -

            Thank you very much John. I added the <div id="page-header"></div> in the general.php file of the Formal White core theme (found in the "layout" subfolder) and changed $iframe = false; TO $iframe = true; in moodle/lib/resourcelib.php line 461 and now the site policy statement loads in all three browsers.

            Show
            Diane Villemure added a comment - Thank you very much John. I added the <div id="page-header"></div> in the general.php file of the Formal White core theme (found in the "layout" subfolder) and changed $iframe = false; TO $iframe = true; in moodle/lib/resourcelib.php line 461 and now the site policy statement loads in all three browsers.
            Hide
            Stephen Overall added a comment -

            I used Clarence's fix (changed $iframe = false; TO $iframe = true successfully using the Anomoly theme in Moodle 2.0.2.

            I found the fix works for IE 8, Firefox 3.6.15, and Chrome 10.0.648.133 at least.

            Thanks! I really appreciate the vibrant Moodle community!

            Show
            Stephen Overall added a comment - I used Clarence's fix (changed $iframe = false; TO $iframe = true successfully using the Anomoly theme in Moodle 2.0.2. I found the fix works for IE 8, Firefox 3.6.15, and Chrome 10.0.648.133 at least. Thanks! I really appreciate the vibrant Moodle community!
            Hide
            Helen Foster added a comment -

            Thanks everyone for your comments and thanks Daniele for fixing this issue. The fix is available in this week's Moodle 2.0.2+.

            Show
            Helen Foster added a comment - Thanks everyone for your comments and thanks Daniele for fixing this issue. The fix is available in this week's Moodle 2.0.2+.
            Hide
            Steve Evans added a comment -

            I'd dispute the last comment about it being available in 2.0.2+ - I just mention it in case anyone else goes half mad trying to work this one out.. I'm using Moodle 2.0.2+ (Build: 20110406) - ie an April download an this bug is still very much there... Gisele's fix sorts it... but I repeat: THIS BUG IS NOT FIXED IN THE APRIL 2.0.2+ BUILD

            Show
            Steve Evans added a comment - I'd dispute the last comment about it being available in 2.0.2+ - I just mention it in case anyone else goes half mad trying to work this one out.. I'm using Moodle 2.0.2+ (Build: 20110406) - ie an April download an this bug is still very much there... Gisele's fix sorts it... but I repeat: THIS BUG IS NOT FIXED IN THE APRIL 2.0.2+ BUILD
            Hide
            Tom Wootton added a comment -

            It is not fixed in Moodle 2.0.2+ (Build: 20110504) either, but it says in the Fix Version/s: above that it is fixed in 2.0.3. Hopefully that will be available soon.

            Show
            Tom Wootton added a comment - It is not fixed in Moodle 2.0.2+ (Build: 20110504) either, but it says in the Fix Version/s: above that it is fixed in 2.0.3. Hopefully that will be available soon.
            Hide
            Tom Wootton added a comment -

            I just updated to Moodle 2.0.3 (Build: 20110505) and it is still broken.

            Show
            Tom Wootton added a comment - I just updated to Moodle 2.0.3 (Build: 20110505) and it is still broken.
            Hide
            Andreas Grabs added a comment -

            Hi, the problem is in fact still there.
            The setting $iframe = true" can not be the reason because the IE since version 5 should be able to show object-tags.
            I found out that the object-tag is a problem on IE if there is a <param> part inside. Just such param is used in moodle while displaying the policy. If I remove the <param> part so the IE shows the embedded object correct.
            A possible solution could be to check if the browser is not IE and only than show this <param> part.
            Best regards
            Andreas

            Show
            Andreas Grabs added a comment - Hi, the problem is in fact still there. The setting $iframe = true" can not be the reason because the IE since version 5 should be able to show object-tags. I found out that the object-tag is a problem on IE if there is a <param> part inside. Just such param is used in moodle while displaying the policy. If I remove the <param> part so the IE shows the embedded object correct. A possible solution could be to check if the browser is not IE and only than show this <param> part. Best regards Andreas
            Hide
            Sam Hemelryk added a comment -

            Thanks Andreas, your fix has been integrated now.
            Cheers
            Sam

            Show
            Sam Hemelryk added a comment - Thanks Andreas, your fix has been integrated now. Cheers Sam
            Hide
            Eloy Lafuente (stronk7) added a comment -

            tested here. But I have NOT IE to test. Anyway, based on Andreas comments current patch seems to detect IE properly and avoid the param to be output.

            Show
            Eloy Lafuente (stronk7) added a comment - tested here. But I have NOT IE to test. Anyway, based on Andreas comments current patch seems to detect IE properly and avoid the param to be output.
            Hide
            Daniele Cordella added a comment -

            I am sorry to ask for this but: how is it possible that this theme is the only one with this problem?
            I even have not IE and I am sure that Andreas was correct... so my investigation went to check the reason of this issue by comparing codes... and I did not found any relevant difference! Please help me to understand!

            Show
            Daniele Cordella added a comment - I am sorry to ask for this but: how is it possible that this theme is the only one with this problem? I even have not IE and I am sure that Andreas was correct... so my investigation went to check the reason of this issue by comparing codes... and I did not found any relevant difference! Please help me to understand!
            Hide
            Andreas Grabs added a comment -

            Hi Daniele,

            I tested differend themes and all had the same issue.
            I also have tested embedded html on blank pages without moodle. Everytime I had the param-part in the object-tag the page was empty.

            Best regards
            Andreas

            Show
            Andreas Grabs added a comment - Hi Daniele, I tested differend themes and all had the same issue. I also have tested embedded html on blank pages without moodle. Everytime I had the param-part in the object-tag the page was empty. Best regards Andreas
            Hide
            Daniele Cordella added a comment -

            Great Andreas,
            this finally opens my eyes!
            Thanks Andreas.

            Show
            Daniele Cordella added a comment - Great Andreas, this finally opens my eyes! Thanks Andreas.
            Hide
            Eloy Lafuente (stronk7) added a comment -

            This is now upstream, yay! Many thanks!

            Show
            Eloy Lafuente (stronk7) added a comment - This is now upstream, yay! Many thanks!
            Hide
            Alex Saavedra added a comment -

            I'm experiencing the same problem in Moodle 2.2.1, using Chrome. The culprit seems to be function resourcelib_embed_general (lib/resourcelib.php). Towards the end of the function a YUI injection is not calculating height appropriately. As a result, although <object> element has proper height=600 and width=800, it is being overriden by additional style="height: 0px;".

            A quick and dirt fix was to comment the following line:
            // $PAGE->requires->js_init_call('M.util.init_maximised_embed', array('resourceobject'), true);

            This way, no "style" element is being added to <object> element, and the site policy now appears as expected.

            Show
            Alex Saavedra added a comment - I'm experiencing the same problem in Moodle 2.2.1, using Chrome. The culprit seems to be function resourcelib_embed_general (lib/resourcelib.php). Towards the end of the function a YUI injection is not calculating height appropriately. As a result, although <object> element has proper height=600 and width=800, it is being overriden by additional style="height: 0px;". A quick and dirt fix was to comment the following line: // $PAGE->requires->js_init_call('M.util.init_maximised_embed', array('resourceobject'), true); This way, no "style" element is being added to <object> element, and the site policy now appears as expected.
            Hide
            Don Hazelwood added a comment -

            I am experiencing this in 2.1.4, IE & Ff tested ...

            Show
            Don Hazelwood added a comment - I am experiencing this in 2.1.4, IE & Ff tested ...
            Hide
            Sam Hemelryk added a comment -

            Hello Alex + Don,

            Sounds like you are both experiencing this issue or something similar to it.
            We don't reopen issues once they are closed however so I have opened MDL-33637 to look into the issues noted.
            Alex, you've dug into things nicely and what you've found will give the developer who gets assigned that issue a good place to start looking thank you.
            Don, can you tell us a little bit more about what you are seeing on MDL-33637 and perhaps if you can remember how you managed to replicate it if it doesn't look like the testing instruction on this issue cover it.

            Please if you could both direct any comments to MDL-33637 now that would be most appreciated

            Cheers
            Sam

            Show
            Sam Hemelryk added a comment - Hello Alex + Don, Sounds like you are both experiencing this issue or something similar to it. We don't reopen issues once they are closed however so I have opened MDL-33637 to look into the issues noted. Alex, you've dug into things nicely and what you've found will give the developer who gets assigned that issue a good place to start looking thank you. Don, can you tell us a little bit more about what you are seeing on MDL-33637 and perhaps if you can remember how you managed to replicate it if it doesn't look like the testing instruction on this issue cover it. Please if you could both direct any comments to MDL-33637 now that would be most appreciated Cheers Sam
            Hide
            Daniel Kaelin added a comment -

            This can also be caused if you put the sitepolicy on a separate domain that is non HTTPS and you are running your site as HTTPS. This causes the browser to block the content.

            Show
            Daniel Kaelin added a comment - This can also be caused if you put the sitepolicy on a separate domain that is non HTTPS and you are running your site as HTTPS. This causes the browser to block the content.

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: