Issue Details (XML | Word | Printable)

Key: MDL-15800
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Jerome Mouneyrac
Reporter: Blake Smith
Votes: 9
Watchers: 15
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Internet Explorer cannot load 'Edit Profile' page

Created: 23/Jul/08 10:54 PM   Updated: 06/Oct/09 12:44 PM
Return to search
Component/s: General
Affects Version/s: 1.9.2
Fix Version/s: 1.8.7, 1.9.3

File Attachments: 1. HTML File editadvanced.html (96 kB)
2. Text File MDL-15800.patch (3 kB)
3. Text File MDL-15800_1.patch (1 kB)

Image Attachments:

1. navigation-canceled.png
(20 kB)
Environment: RHEL 5, Apache 2, PHP 5, MySQL 5
Issue Links:
Cloners
 
Duplicate
 

Database: MySQL
Participants: andrea gordon, Blake Smith, Daniel Miksik, Dennis Rochford, Dongsheng Cai, Jason Bittel, Jenny Gray, Jerome Mouneyrac, Larry M Elchuck, Ph.D., Maikon Graeff, Mark Johnson, Martin Dougiamas, Nicolas Connault, Paolo Oprandi, Pedro Remedios, Petr Skoda and Ryan Smith
Security Level: None
QA Assignee: Dongsheng Cai
Resolved date: 10/Sep/09
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
I have reopened the previous issue MOD-10296. Apparently this has shown it's head again in the 1.9.2 branch.

After upgrading to 1.9.2, 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://moodlesite/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.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Blake Smith added a comment - 23/Jul/08 10:57 PM
Updated original issue (MOD-10296) to reflect 1.9.2

Jenny Gray added a comment - 23/Jul/08 11:30 PM
I would guess the cause is similar to last time - some image in the edit profile screen isn't being rendered with https:// in the url.

I know I fixed it last time, and I do care because it'll be an issue for me too, but I won't have access to an HTTPS server with 1.9.2 on it until November, so I'm going to assign this back to the default in case some-one else can fix it quicker than me. Unfortunately without an HTTPS server to test on, I'd be shooting in the dark.


Martin Dougiamas added a comment - 23/Jul/08 11:52 PM
Hi Nicolas, could you please look at this one urgently?

Nicolas Connault added a comment - 24/Jul/08 08:25 PM
I tested this on a windows vista box with IE7 and https. I could not reproduce the error. Could you please provide more info about your environment? Do you use a different theme than the default one? Do you have any custom code?

Blake Smith added a comment - 25/Jul/08 12:52 AM - edited
Nicolas, we are running Moodle 1.9.2 on the following platform:

Red Hat Linux Enterprise 5
Apache 2.2.3
PHP 5.1.6
MySQL 5.0.45

We currently use the standard - "formal_white" theme that is bundled with Moodle. There is no custom code running on this server. As for themes, this issue is occurring regardless of the theme applied.

Is there any way to obtain the modifications Jenny Gray made to correct this issue the first time. It's is an exact duplicate of the previous issue. I would apply 1.9.3 if it corrects the issue, but this is a production server.

Thanks in advance.


Maikon Graeff added a comment - 25/Jul/08 02:03 AM
Its happening on my sites too.
we are running on the following platform:

Moodle 1.9.2 (Build 20080711) - All Standard
SuSe Linux Enterprise Server 10
Apache 2.2.3
PHP 5.2.5
MySQL 5.0.26

Thanks.


Jenny Gray added a comment - 25/Jul/08 04:44 PM
Nick we did find this a difficult bug to reproduce last time, as its some dodgy IE flaw that can't handle the HTTP and HTTPS mix properly. On some PC builds its OK.

Blake, Maikon, you've given your server setups, but it might help if you give your client setup, as that's where the problem is occuring.

The code I put in is still there, so this is a similar problem in a different area. I'm sure the same approach can be used to fix it, but you need to track down what is being rendered onto the page in HTTP rather than HTTPS first.

To do that you'll need a different browser, like Firefox. Load the profile page and when it says something like "include unsecure items", say NO and try to work out what's missing. Or view the HTML and go through it with a fine toothcomb looking for HTTP not HTTPS (but not in any <a href""> because a HTTP link won't be the cause, it'll be an image or a javascript/CSS etc embedded file.


Daniel Miksik added a comment - 07/Aug/08 07:50 AM - edited
It's the user picture that has HTTP instead of HTTPS in src.

I believe the bug was introduced in 1.970.2.98 version of lib/weblib.php, see http://cvs.moodle.org/moodle/lib/weblib.php?r1=1.970.2.97&r2=1.970.2.98&pathrev=MOODLE_19_STABLE
The src of the picture is worked out using the get_file_url() function that does not take into account the carefully set-up $wwwroot a few lines above – setting up $wwwroot is $HTTPSPAGEREQUIRED aware but that has no effect in get_file_url().


Dennis Rochford added a comment - 13/Aug/08 07:42 AM
I made a custom fix on our version of Moodle since it has been causing us some grief. Below is the patch for my mods:

Index: filelib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/filelib.php,v
retrieving revision 1.50.2.19
diff -u -r1.50.2.19 filelib.php
— filelib.php 11 Jul 2008 02:28:32 -0000 1.50.2.19
+++ filelib.php 12 Aug 2008 04:01:14 -0000
@@ -19,6 +19,9 @@
case 'user':
$url = $CFG->wwwroot."/user/pix.php";
break;
+ case 'httpsuser': // USQ MOOD-1890
+ $url = $CFG->httpswwwroot."/user/pix.php";
+ break;
case 'usergroup':
$url = $CFG->wwwroot."/user/pixgroup.php";
break;
Index: weblib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v
retrieving revision 1.970.2.101
diff -u -r1.970.2.101 weblib.php
— weblib.php 22 Jul 2008 14:06:48 -0000 1.970.2.101
+++ weblib.php 12 Aug 2008 04:00:53 -0000
@@ -4398,8 +4412,10 @@
$class = "userpicture";
if (!empty($HTTPSPAGEREQUIRED)) { $wwwroot = $CFG->httpswwwroot; + $pictype = 'httpsuser'; // USQ MOOD-1890 } else { $wwwroot = $CFG->wwwroot; + $pictype = 'user'; // USQ MOOD-1890 }

if (is_null($picture)) {
@@ -4408,7 +4424,7 @@

if ($picture) { // Print custom user picture require_once($CFG->libdir.'/filelib.php'); - $src = get_file_url($user->id.'/'.$file.'.jpg', null, 'user'); + $src = get_file_url($user->id.'/'.$file.'.jpg', null, $pictype); // USQ MOOD-1890 } else { // Print default user pictures (use theme version if available)
$class .= " defaultuserpic";
$src = "$CFG->pixpath/u/$file.png";


Pedro Remedios added a comment - 16/Sep/08 02:24 PM
Works fine under WinXP SP3 IE7.

Jason Bittel added a comment - 17/Sep/08 12:58 AM
To expand the testing set, we have a number of Windows XP SP3 machines with IE7 that demonstrate this problem, so there must be some other configuration or setting that triggers it.

Martin Dougiamas added a comment - 06/Oct/08 01:55 PM
Jerome? Can you please test and check in the patch from Dennis above in 1.9.3 and HEAD?

http://tracker.moodle.org/browse/MDL-15800?focusedCommentId=54278#action_54278


Jerome Mouneyrac added a comment - 06/Oct/08 05:21 PM
Ok I tested the patch it works for the image link. There is also a problem with YUI javascript declaration which has the same problem. I come with a patch soon.

Jerome Mouneyrac added a comment - 06/Oct/08 05:26 PM
I attached a patch

Jerome Mouneyrac added a comment - 07/Oct/08 10:29 AM
I commited in 1.9 and HEAD.
Note: there is still a "non-secure" box on Head. It is cause by some Javascript code from the File Picker. I have a look, I'll write another issue.

Nicolas Connault added a comment - 07/Oct/08 07:44 PM
Jerome, your fix has a bug, which causes require_js problems. One user reported it in the forums, and Helen and I both came across it independently of each other.

The solution suggested by this forum participant works

http://moodle.org/mod/forum/discuss.php?d=106233


Ryan Smith added a comment - 08/Oct/08 12:53 AM
We just found this problem. Quizzes are broken...you get a require_js: http://moodle/mod/quiz/quiz.js - file not found.

We changed this line in moodle/lib/ajax/ajaxlib.php:

$testpath = str_replace($wwwroot, $CFG->dirroot, $libpath);

to

$testpath = str_replace($CFG->wwwroot, $CFG->dirroot, $libpath);

it fixed it.


Larry M Elchuck, Ph.D. added a comment - 08/Oct/08 04:26 AM
This problem also impacts the ajax marking block, as I reported in http://moodle.org/mod/forum/discuss.php?d=78929#p473406

Petr Skoda added a comment - 08/Oct/08 06:10 AM
patch from forum committed - thanks!
and also merged the code to HEAD

Jerome Mouneyrac added a comment - 08/Oct/08 09:24 AM
Sorry I just saw that ( Thanks for the reports and the quick fix.

Dongsheng Cai added a comment - 14/Oct/08 11:10 AM
Worked, Thanks all, closing

andrea gordon added a comment - 10/Jun/09 11:13 PM
Seems to be an issue in 1.9.5 again - will the same patch fix?

Thanks,

Andrea


Jerome Mouneyrac added a comment - 16/Jun/09 10:16 AM
Hi Andrea, I could not reproduce.
The problem was that when https was activated on the edit profil page, some image/javascript link started with 'http://' instead of 'https://'
I cannot find anything wrong with the last CVS update (only few href are starting with 'http://' but that should not be a problem).

Is the same problem that you have?
Is someone else having a problem on this page?


Jason Bittel added a comment - 16/Jun/09 11:49 PM
We are experiencing this same (or similar) problem with Moodle 1.9.5 as well.

I can reproduce the problem by going to the Edit Profile link with IE7. As the page is loading, it displays the warning dialog that says "This page contains both secure and nonsecure items." Clicking either Yes or No will allow the page to load, but the text field for the Description box is unusable (no text is visible in it and you cannot type in it).

When clicking No on the dialog, the standard IE "Navigation to the page has been canceled" message is displayed in half of the text box which leads me to believe that this issue is directly related to the display of that field somehow.


Jerome Mouneyrac added a comment - 17/Jun/09 09:43 AM
Hi Jason,
can you attach the page source code in this issue. I'll have a look at it. Thanks.

Jason Bittel added a comment - 18/Jun/09 12:25 AM
Here's the IE7 page source for the profile edit page. I've also attached a graphic that shows what is displayed when I click 'No' on the secure/nonsecure items dialog box. If I click 'Yes' I get the same behavior, just without the navigation canceled message. Since that's the only element that appears to change on the page based on the response to that dialog, I'm assuming that element is the source of the problems.

Thanks!


Jerome Mouneyrac added a comment - 18/Jun/09 09:24 AM
Thanks Jason, from a fast review of your source code I can see two potential problems:
<div class="singlebutton"><form action="http://converge.corban.edu/user/editadvanced.php"
<div class="adminsearchform"><form action="http://converge.corban.edu/admin/search.php"

I'll have a look today where it comes from, thanks.


Jerome Mouneyrac added a comment - 18/Jun/09 12:01 PM
Hum ... this 'adminsearchform' tag comes from the 'Site Administration block'.
Did you hack Moodle to display this block on the edit profil page?
Or maybe there is a way that I don't know in order to display this block on the edit profil page. In this case could you details the step to reproduce it?

Thanks


Jason Bittel added a comment - 23/Jun/09 02:51 AM
We haven't modified Moodle to display that block, and I'm not sure of a setting that would cause that to be displayed on the profile page. I can poke around and see what I can find, but I don't know what it would be right off.

Mark Johnson added a comment - 23/Jun/09 10:54 PM
We also experience this problem with IE 6.
I don't know the exact version we're using (our wiki says it's 1.9.1+), but all the changes in the attached patch file already exist.

Mark Johnson added a comment - 24/Jun/09 04:54 PM
It seems to me that the problem is being caused by the iframe used in the htmleditor form element. It's src attribute starts http:// instead of https://, does this seem a likely cause?

I'm trying to track down the code that generates it to make a fix, but I daresay others would find it quicker than me.


Jerome Mouneyrac added a comment - 24/Jun/09 05:45 PM
Mark, src="http://..." will cause this problem.
I still cannot reproduce so it's a bit more difficult to fix.
If it comes from the htmlaera iframe, the problem could be located /lib/editor/htmlaera/htmlaera.php line 32-36 (but I'm just trying to guess). I'll have another look tomorrow.

Mark Johnson added a comment - 24/Jun/09 06:38 PM
More of a workaround than a fix. This extends the "ugly hack" used to open the htmleditor popup when using https to apply to the iframe as well.
Tested it in Firefox and IE6, seems to work for me, although it's not the most elegant solution.

Paolo Oprandi added a comment - 25/Aug/09 09:51 PM
I have this problem on my 1.95 install going live today. I haven't experienced this on my near identical development system. The browser is Mac Safari, I am in maintenance mode and its inconsistent.

Jerome Mouneyrac added a comment - 27/Aug/09 11:29 AM - edited
I've just noticed that Jonathan committed a fix the 9 Jun 2009 which is really similar to Mark patch (Mark patch patches a previous version). The first report of the problem coming back has been done the 10 Jun 2009 by Andrea.

Mark, can you confirm that you still or not have the bug on the last CVS or 1.9.5+ ?
Can anyone reproducing the bug confirm using the last CVS or 1.9.5+?


Jerome Mouneyrac added a comment - 10/Sep/09 09:51 AM - edited
Hi,
I come back to this issue. Without answer I conclude that the latest reports didn't concern the last fixed Moodle version.
The latest attached patch patches a version anterior to the actual Moodle code. And the actual Moodle code fixes the bug as the patch does. I'll be marking this issue as fixed.
If I'm wrong, you are more than free to reopen this issue and comment (indicate your Moodle version + complete steps to reproduce).
Thanks all for your participation

Dongsheng Cai added a comment - 06/Oct/09 12:44 PM
close, thanks everyone