Moodle
  1. Moodle
  2. MDL-10296

Internet Explorer cannot load 'Edit Profile' page

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.8.2, 1.9
    • Component/s: General
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Rank:
      29363

      Description

      After upgrading to 1.8.1+, the following issue has appeared in our Moodle site:

      Under Internet Explorer (both 6 and 7), visiting the Edit Profile tab while viewing a user profile causes the browser to complain loudly and sometimes crash. It partially loads the page and then pops up a box saying that the page contains both secure/unsecure items. Clicking on either the 'Yes' or 'No' options causes it to pop up another error dialog that says

      Internet Explorer cannot open the Internet site https://convergesite/user/editadvanced.php?id=3&course=1

      The browser then redirects to an internal IE error page. This same page works fine under Firefox, and it also works fine under IE if you manually change the change to http:// instead of https://. Disabling https:// would be an acceptable workaround for now, but there doesn't seem to be a way to independently change it without also disabling it on the login.

        Issue Links

          Activity

          Hide
          Jason Bittel added a comment -

          I just wanted to add some further information. First, I should have clarified that I replaced the actual hostname of the server above with 'convergesite'. I tested this on two different installations of Moodle and got the same result. I changed the hostname to generalize it because of the multiple installations.

          I've tested this on a number of different client machines and have gotten the same results, although I also have some reports from users who don't seem to be affected. Additionally, I have found one machine that displays the secure/unsecure dialog, but then works correctly afterwards. There must be some setting in IE that causes it to break, but since I obviously don't have control over all the client machines, I'm trying to find a fix on the server side. Could it be related to the unsecure items that IE is complaining about?

          Show
          Jason Bittel added a comment - I just wanted to add some further information. First, I should have clarified that I replaced the actual hostname of the server above with 'convergesite'. I tested this on two different installations of Moodle and got the same result. I changed the hostname to generalize it because of the multiple installations. I've tested this on a number of different client machines and have gotten the same results, although I also have some reports from users who don't seem to be affected. Additionally, I have found one machine that displays the secure/unsecure dialog, but then works correctly afterwards. There must be some setting in IE that causes it to break, but since I obviously don't have control over all the client machines, I'm trying to find a fix on the server side. Could it be related to the unsecure items that IE is complaining about?
          Hide
          Jason Bittel added a comment -

          It appears that the problem is caused by the user's picture not correctly being displayed with https://. That leads to the secure/unsecure dialog with precedes the other problems. If I force the user picture to display as a secure link, then the page loads fine within IE and works correctly.

          Show
          Jason Bittel added a comment - It appears that the problem is caused by the user's picture not correctly being displayed with https:// . That leads to the secure/unsecure dialog with precedes the other problems. If I force the user picture to display as a secure link, then the page loads fine within IE and works correctly.
          Hide
          Kenneth Newquist added a comment -

          I've reproduced this error on Internet Explorer 6/Windows XP under Moodle 1.8.1 (2007021510). I agree that the problem is the non-secure link to the user photo on the profile page; profiles that don't have a user picture don't have this problem.

          An immediate workaround is to tell people to load the page without displaying the non-secure image; when I did that the rest of the page loaded properly (though I haven't tried that in IE 7 yet). Firefox 2.x and Safari 2.x don't have this problem.

          Show
          Kenneth Newquist added a comment - I've reproduced this error on Internet Explorer 6/Windows XP under Moodle 1.8.1 (2007021510). I agree that the problem is the non-secure link to the user photo on the profile page; profiles that don't have a user picture don't have this problem. An immediate workaround is to tell people to load the page without displaying the non-secure image; when I did that the rest of the page loaded properly (though I haven't tried that in IE 7 yet). Firefox 2.x and Safari 2.x don't have this problem.
          Hide
          Anthony Peacock added a comment - - edited

          I've seen this exact issue. It is defintiely caused by the src value for the user's picture using a http link instead of a https link.

          Looking at the code the following files need a fix:

          user/edit_form.php
          user/editadvanced_form.php

          Around line 94 in user/editadvanced_form.php replace:

          $image_el->setValue(print_user_picture($user->id, SITEID, $user->picture, 64, true, false, '', true));

          With:

          if(empty($CFG->loginhttps))

          { $picvalue = print_user_picture($user->id, SITEID, $user->picture, 64,true,false,'',true); }

          else

          { $picvalue = str_replace('http:','https:', print_user_picture($user->id, SITEID, $user->picture, 64,true,false,'',true)); }

          $image_el->setValue($picvalue);

          And do the same around line 62 in user/edit_form.php

          I don't claim to know the code very well, but this edit seems to have fixed the problem on my server and appears to match idoms used in other places.

          Show
          Anthony Peacock added a comment - - edited I've seen this exact issue. It is defintiely caused by the src value for the user's picture using a http link instead of a https link. Looking at the code the following files need a fix: user/edit_form.php user/editadvanced_form.php Around line 94 in user/editadvanced_form.php replace: $image_el->setValue(print_user_picture($user->id, SITEID, $user->picture, 64, true, false, '', true)); With: if(empty($CFG->loginhttps)) { $picvalue = print_user_picture($user->id, SITEID, $user->picture, 64,true,false,'',true); } else { $picvalue = str_replace('http:','https:', print_user_picture($user->id, SITEID, $user->picture, 64,true,false,'',true)); } $image_el->setValue($picvalue); And do the same around line 62 in user/edit_form.php I don't claim to know the code very well, but this edit seems to have fixed the problem on my server and appears to match idoms used in other places.
          Hide
          Charlie Owen (SonniesEdge) added a comment -

          I can confirm that Anthony's patch solves the IE crashing problem on a Moodle 1.8.2+ system.

          However, I still get the "secure and insecure items" warning (without the crash!), despite there being only http content on the page - I've checked the displayed page source and nothing is coming in over http. Anyone else see this?

          Show
          Charlie Owen (SonniesEdge) added a comment - I can confirm that Anthony's patch solves the IE crashing problem on a Moodle 1.8.2+ system. However, I still get the "secure and insecure items" warning (without the crash!), despite there being only http content on the page - I've checked the displayed page source and nothing is coming in over http. Anyone else see this?
          Hide
          Andy Tagliani added a comment -

          Hi all

          I can not confirm this isue in moodle 1.8.2+!

          But i have another problem stay in touch with this features. In Internet Explorer 7 (full patch updates) the button "Show Advance" did not change when click on this button. The problem shows me on sites with and without https:// ...!

          It is not a problem for me, but some users see that the button not change and did not look if the fields are now advanced or not. Yes this is the problem of the users, but the bug is in moodle or in ie7, anyway not enough testing on ie7, its my meaning.

          Theres so many problems in the last time, sorry to say this moodlers, our customers look for antother LMS. A lot of problems in moodle 1.8.x not solved, now moodle 1.9.x is on the way. Why dont they concentrate on one version with only some bugs!

          Andy

          Show
          Andy Tagliani added a comment - Hi all I can not confirm this isue in moodle 1.8.2+! But i have another problem stay in touch with this features. In Internet Explorer 7 (full patch updates) the button "Show Advance" did not change when click on this button. The problem shows me on sites with and without https:// ...! It is not a problem for me, but some users see that the button not change and did not look if the fields are now advanced or not. Yes this is the problem of the users, but the bug is in moodle or in ie7, anyway not enough testing on ie7, its my meaning. Theres so many problems in the last time, sorry to say this moodlers, our customers look for antother LMS. A lot of problems in moodle 1.8.x not solved, now moodle 1.9.x is on the way. Why dont they concentrate on one version with only some bugs! Andy
          Hide
          Jenny Gray added a comment -

          I confirm, its happening on my live sites too. I have committed a patch which solves the problem before the edit_form so that it should work everywhere the user picture is displayed.

          In weblib.php the print_user_picture function was always returning an http source for the image. I've changed this to detect if HTTPS is required, and output the appropriate source.

          That means the edit forms won't need changing

          I am now not seeing the secure/insecure error at all, but I've had to go through my custom themes with a fine toothcomb to iron out any gremlins in there. I'm also unable to reproduce the bug regarding the show/hide advanced button. I'm going to close this tracker item, as the main issue is, I believe, fixed. If any of you have the other problems, you'd better file them as separate issues I think.

          Show
          Jenny Gray added a comment - I confirm, its happening on my live sites too. I have committed a patch which solves the problem before the edit_form so that it should work everywhere the user picture is displayed. In weblib.php the print_user_picture function was always returning an http source for the image. I've changed this to detect if HTTPS is required, and output the appropriate source. That means the edit forms won't need changing I am now not seeing the secure/insecure error at all, but I've had to go through my custom themes with a fine toothcomb to iron out any gremlins in there. I'm also unable to reproduce the bug regarding the show/hide advanced button. I'm going to close this tracker item, as the main issue is, I believe, fixed. If any of you have the other problems, you'd better file them as separate issues I think.
          Hide
          Ann Adamcik added a comment -

          We upgraded to the latest 1.8_STABLE on Friday and tested this - the problem is still occurring.

          It looks like the global $HTTPSPAGEREQUIRED needs to be defined in the print_user_picture() function in lib/weblib.php:

          function print_user_picture($userid, $courseid, $picture, $size=0, $return=false, $link=true, $target='', $alttext=true) {
          ! global $CFG, $HTTPSPAGEREQUIRED;

          The issue with the Show/Hide Advanced button is MDL-10506.

          Show
          Ann Adamcik added a comment - We upgraded to the latest 1.8_STABLE on Friday and tested this - the problem is still occurring. It looks like the global $HTTPSPAGEREQUIRED needs to be defined in the print_user_picture() function in lib/weblib.php: function print_user_picture($userid, $courseid, $picture, $size=0, $return=false, $link=true, $target='', $alttext=true) { ! global $CFG, $HTTPSPAGEREQUIRED; The issue with the Show/Hide Advanced button is MDL-10506 .
          Hide
          Jenny Gray added a comment -

          I agree - sorry. I've added this now to 1.8 branch and HEAD.

          Show
          Jenny Gray added a comment - I agree - sorry. I've added this now to 1.8 branch and HEAD.

            People

            • Votes:
              6 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: