Moodle
  1. Moodle
  2. MDL-25190

ERROR: Invalid JSON string on filepicker

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Not a bug
    • Affects Version/s: 2.0, 2.1.6, 2.2.3, 2.3
    • Fix Version/s: None
    • Component/s: Filepicker
    • Environment:
      Any, moodle.org for example
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
      git@github.com:vadimonus/moodle.git

      Description

      Every time I tried to pick a file and the filepicker window appeared, it gave me the error: "Invalid JSON string", and I couldn't use it.
      The problem's described and solved here http://yuilibrary.com/projects/yui3/ticket/2531217

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Dongsheng Cai added a comment -

            Hi, Pablo

            Which repository plugin were you using when you got the error?

            Show
            Dongsheng Cai added a comment - Hi, Pablo Which repository plugin were you using when you got the error?
            Hide
            Pablo Niklas added a comment -

            Hi,

            No repository plugin at all.

            Show
            Pablo Niklas added a comment - Hi, No repository plugin at all.
            Hide
            Dongsheng Cai added a comment -

            can you please try to select one from the left side, to see if you got the same error?

            Show
            Dongsheng Cai added a comment - can you please try to select one from the left side, to see if you got the same error?
            Hide
            Pablo Niklas added a comment -

            Hi,

            I went to http://<moodle url>/admin/repository.php?section=managerepositories&lang=en
            and I have "Enable and visible" the following plugins: Server files, Recent files, Upload a file, and private files.
            ¿Is that what you meant?

            If this helps:
            In http://<moodle url>/admin/repository.php?action=edit&repos=local the "repository plugin name" is empty.

            Thanks.

            Show
            Pablo Niklas added a comment - Hi, I went to http://<moodle url>/admin/repository.php?section=managerepositories&lang=en and I have "Enable and visible" the following plugins: Server files, Recent files, Upload a file, and private files. ¿Is that what you meant? If this helps: In http://<moodle url>/admin/repository.php?action=edit&repos=local the "repository plugin name" is empty. Thanks.
            Hide
            Pablo Niklas added a comment -

            It has been fixed in Moodle 2.0 (Build: 20101125)

            Show
            Pablo Niklas added a comment - It has been fixed in Moodle 2.0 (Build: 20101125)
            Hide
            Dongsheng Cai added a comment -

            resolved

            Show
            Dongsheng Cai added a comment - resolved
            Hide
            Alan Whittamore added a comment -

            I still get this for the 'Recent files' section on build 20101125. Details are:
            ERROR: Invalid JSON string

            Warning: preg_match(): Compilation failed: nothing to repeat at offset 0 in /var/www/moodle2/repository/lib.php on line 1382

            Call Stack:
            0.0023 426940 1.

            {main}

            () /var/www/moodle2/repository/repository_ajax.php:0
            0.2195 12796224 2. repository_recent->get_listing() /var/www/moodle2/repository/repository_ajax.php:134
            0.2249 12832120 3. array_filter() /var/www/moodle2/repository/recent/lib.php:113
            0.2249 12832240 4. repository->filter() /var/www/moodle2/repository/lib.php:0
            0.2264 12847552 5. preg_match() /var/www/moodle2/repository/lib.php:1382
            I changed line 1382 in /repository/lib.php
            from if (preg_match('#'.$ext.'$#', $value['title'])) {
            to if (preg_match('#.'.$ext.'$#', $value['title'])) {
            (only the dot added after the first #) and that works fine!
            Hope this throws some light on the problem.

            Show
            Alan Whittamore added a comment - I still get this for the 'Recent files' section on build 20101125. Details are: ERROR: Invalid JSON string Warning: preg_match(): Compilation failed: nothing to repeat at offset 0 in /var/www/moodle2/repository/lib.php on line 1382 Call Stack: 0.0023 426940 1. {main} () /var/www/moodle2/repository/repository_ajax.php:0 0.2195 12796224 2. repository_recent->get_listing() /var/www/moodle2/repository/repository_ajax.php:134 0.2249 12832120 3. array_filter() /var/www/moodle2/repository/recent/lib.php:113 0.2249 12832240 4. repository->filter() /var/www/moodle2/repository/lib.php:0 0.2264 12847552 5. preg_match() /var/www/moodle2/repository/lib.php:1382 I changed line 1382 in /repository/lib.php from if (preg_match('#'.$ext.'$#', $value ['title'] )) { to if (preg_match('#.'.$ext.'$#', $value ['title'] )) { (only the dot added after the first #) and that works fine! Hope this throws some light on the problem.
            Hide
            Peter Svec added a comment -

            What browser do you use? Invalid JSON string is some kind of Opera bug.

            Show
            Peter Svec added a comment - What browser do you use? Invalid JSON string is some kind of Opera bug.
            Hide
            Helen Foster added a comment -

            Reopening for further investigation after further reports suggesting that the problem occurs when using Opera.

            Show
            Helen Foster added a comment - Reopening for further investigation after further reports suggesting that the problem occurs when using Opera.
            Hide
            Dongsheng Cai added a comment -

            Hi, Alan

            the $ext already contains the dot, have you made any change to lib/filestorage/file_types.mm? moodle will parse this file to get file extensions, if asterisk character added to this file, you may see this error.

            Show
            Dongsheng Cai added a comment - Hi, Alan the $ext already contains the dot, have you made any change to lib/filestorage/file_types.mm? moodle will parse this file to get file extensions, if asterisk character added to this file, you may see this error.
            Hide
            Steve Bond added a comment -

            Dear all,

            It's not just an Opera bug, we get it here with IE8, Firefox (3.6.13) and Safari (Win 5.0.3), and on various different PCs (all Win XP).

            Our Moode build is 20110125 (we're tracking HEAD).

            Steps to reproduce (but it happens for all uses of the File Picker):

            • Add a resource > File
            • Insert name and description
            • Click Add...

            The error popup either appears immediately, or else appears once you try to click one of the links on left ("Server files" etc.) It reappears each time you try to do anything in this popup.

            File picker is completely unusable as a result.

            Steve

            Show
            Steve Bond added a comment - Dear all, It's not just an Opera bug, we get it here with IE8, Firefox (3.6.13) and Safari (Win 5.0.3), and on various different PCs (all Win XP). Our Moode build is 20110125 (we're tracking HEAD). Steps to reproduce (but it happens for all uses of the File Picker): Add a resource > File Insert name and description Click Add... The error popup either appears immediately, or else appears once you try to click one of the links on left ("Server files" etc.) It reappears each time you try to do anything in this popup. File picker is completely unusable as a result. Steve
            Hide
            Trevor Johnson added a comment -

            Hi Everyone

            Have the same issue, but only files larger than around 28MB.

            I am testing the course restore process in Moodle 2.0. The error occurs when uploading the course backups via the file picker.

            I have tested with multiple file sizes.
            These all work 5,779KB, 8,820KB, 12,927KB, 20,927KB, 26,375KB, 28,785KB
            These all fail 29,417KB, 30,404KB, 40,147KB.
            -----------------------
            Server Error404 - File or directory not found.
            The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
            -----------------------

            Get the same result using IE8 and Firefox.

            Our build is:
            Moodle 2.0.2 (Build: 20110221)
            PHP 5.3.5

            PHP upload settings
            post_max_size = 2000M
            upload_max_filesize = 2000M

            Moodle upload setting
            Moodle course Maximum upload size = 2GB

            HTH

            TJ

            Show
            Trevor Johnson added a comment - Hi Everyone Have the same issue, but only files larger than around 28MB. I am testing the course restore process in Moodle 2.0. The error occurs when uploading the course backups via the file picker. I have tested with multiple file sizes. These all work 5,779KB, 8,820KB, 12,927KB, 20,927KB, 26,375KB, 28,785KB These all fail 29,417KB, 30,404KB, 40,147KB. ----------------------- Server Error404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable. ----------------------- Get the same result using IE8 and Firefox. Our build is: Moodle 2.0.2 (Build: 20110221) PHP 5.3.5 PHP upload settings post_max_size = 2000M upload_max_filesize = 2000M Moodle upload setting Moodle course Maximum upload size = 2GB HTH TJ
            Hide
            Trevor Johnson added a comment -

            Sorry missed part of the error message, the full message is...
            -----------------------
            ERROR: Invalid JSON string

            Server Error404 - File or directory not found.
            The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
            -----------------------

            Show
            Trevor Johnson added a comment - Sorry missed part of the error message, the full message is... ----------------------- ERROR: Invalid JSON string Server Error404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable. -----------------------
            Hide
            Jason Ilicic added a comment -

            Looks like this issue is caused when you have HTTPS login enabled, but your WWWROOT set to "http://". It seems like the "require_login()" function is causing the problem on my end where it cannot detect the $USER object.

            Show
            Jason Ilicic added a comment - Looks like this issue is caused when you have HTTPS login enabled, but your WWWROOT set to "http://". It seems like the "require_login()" function is causing the problem on my end where it cannot detect the $USER object.
            Hide
            Duncan Withers added a comment -

            I had this issue also. I found that the issue was the proxy host setting was wrong.

            Show
            Duncan Withers added a comment - I had this issue also. I found that the issue was the proxy host setting was wrong.
            Hide
            Robert Silvie II added a comment -

            I'm getting this error with IE8/IE9/Chrome/Firefox/Safari on a Windows 7 machine.

            Build settings:
            Moodle 2.0.1
            PHP 5.2.18

            Server:
            Windows 2008 R2 SP1
            SQL Server 2008

            PHP upload settings:
            post_max_size = 256M
            upload_max_size = 256M

            Show
            Robert Silvie II added a comment - I'm getting this error with IE8/IE9/Chrome/Firefox/Safari on a Windows 7 machine. Build settings: Moodle 2.0.1 PHP 5.2.18 Server: Windows 2008 R2 SP1 SQL Server 2008 PHP upload settings: post_max_size = 256M upload_max_size = 256M
            Hide
            Jason Ilicic added a comment -

            Hmm, I thought I attached my patch but I guess I didn't. This is only a temporary fix, not really something that should go in to core, but it works

            Show
            Jason Ilicic added a comment - Hmm, I thought I attached my patch but I guess I didn't. This is only a temporary fix, not really something that should go in to core, but it works
            Hide
            Billy Keene added a comment -

            The below fix is only for IIS servers

            When receiving the following error, you may have an IIS7/7.5 or older upload limit. This is set to 30MB. After searching the web I found the following http://www.webtrenches.com/post.cfm/iis7-file-upload-size-limits which informs you on how to adjust the settings so you no longer get the error message.
            -----------------------
            ERROR: Invalid JSON string

            Server Error404 - File or directory not found.
            The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
            -----------------------

            To adjust the settings go to your web.config file (or create) in your moodle folder and add the below code

            <system.webServer>
            <security>
            <requestFiltering>
            <requestLimits maxAllowedContentLength="524288000"/>
            </requestFiltering>
            </security>
            </system.webServer>

            Please keep in mind that the maxAllowedContentLength is in bytes (the above example is 500 megabytes) so please adjust this accordingly.
            Please also ensure that your php settings are adjusted accordingly as well.

            PHP upload settings:
            post_max_size = 500M
            upload_max_size = 500M

            Show
            Billy Keene added a comment - The below fix is only for IIS servers When receiving the following error, you may have an IIS7/7.5 or older upload limit. This is set to 30MB. After searching the web I found the following http://www.webtrenches.com/post.cfm/iis7-file-upload-size-limits which informs you on how to adjust the settings so you no longer get the error message. ----------------------- ERROR: Invalid JSON string Server Error404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable. ----------------------- To adjust the settings go to your web.config file (or create) in your moodle folder and add the below code <system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="524288000"/> </requestFiltering> </security> </system.webServer> Please keep in mind that the maxAllowedContentLength is in bytes (the above example is 500 megabytes) so please adjust this accordingly. Please also ensure that your php settings are adjusted accordingly as well. PHP upload settings: post_max_size = 500M upload_max_size = 500M
            Hide
            Alex added a comment -

            Hi! Both on local server (WinXP, Apache, PHP 5.3.3) and on web-hosting the same error in Opera (Latest Moodle 2.0.3+).
            I've tried 20110317-Fix_AJAX_WWWROOT.patch: just changed in "lib/outputrequirementslib.php" "$CFG->httpswwwroot" to "$CFG->wwwroot", cleared cache via Moodle Development->ClearCache and tried again to upload something in Private area - again: "ERROR: Invalid JSON string". Please, anyone can solve it?...

            Show
            Alex added a comment - Hi! Both on local server (WinXP, Apache, PHP 5.3.3) and on web-hosting the same error in Opera (Latest Moodle 2.0.3+). I've tried 20110317-Fix_AJAX_WWWROOT.patch: just changed in "lib/outputrequirementslib.php" "$CFG->httpswwwroot" to "$CFG->wwwroot", cleared cache via Moodle Development->ClearCache and tried again to upload something in Private area - again: "ERROR: Invalid JSON string". Please, anyone can solve it?...
            Hide
            Philipp Pavelka added a comment - - edited

            I'm also experiencing this problem with Opera and Moodle 2.1+.
            It can be easily reproduced on http://demo.moodle.net/.

            I had the problem with IE9 too, but now it's working with IE, at least for me.

            Show
            Philipp Pavelka added a comment - - edited I'm also experiencing this problem with Opera and Moodle 2.1+. It can be easily reproduced on http://demo.moodle.net/ . I had the problem with IE9 too, but now it's working with IE, at least for me.
            Hide
            Shevchenko Dmitry added a comment -

            It seems like http://demo.moodle.net does not suffer from this bug anymore. I managed to successfully pick a file where. What version are they using now? 2.1? And did they need any additional tuning of the site in order to get rid of this bug?

            Show
            Shevchenko Dmitry added a comment - It seems like http://demo.moodle.net does not suffer from this bug anymore. I managed to successfully pick a file where. What version are they using now? 2.1? And did they need any additional tuning of the site in order to get rid of this bug?
            Hide
            Shevchenko Dmitry added a comment -

            But moodle.org still suffers from it. Tried to upload a new avatar for my profile inside opera, and got the same error. So, the question is - what version is used on http://demo.moodle.net and what additional settings do we need to adjust in order to get rid of this error? Because it's really frustrating, and we have a lot of users working with Opera. They won't like the idea of having to swicht to Mozilla or Chrome.

            Show
            Shevchenko Dmitry added a comment - But moodle.org still suffers from it. Tried to upload a new avatar for my profile inside opera, and got the same error. So, the question is - what version is used on http://demo.moodle.net and what additional settings do we need to adjust in order to get rid of this error? Because it's really frustrating, and we have a lot of users working with Opera. They won't like the idea of having to swicht to Mozilla or Chrome.
            Hide
            Philipp Pavelka added a comment - - edited

            http://demo.moodle.net and Opera still produces the same error for me.
            Here is also a report on the Opera forums but no one replied yet.
            I would like to know if this problem is maybe Opera's fault.

            Show
            Philipp Pavelka added a comment - - edited http://demo.moodle.net and Opera still produces the same error for me. Here is also a report on the Opera forums but no one replied yet. I would like to know if this problem is maybe Opera's fault.
            Hide
            AL Rachels added a comment -

            Using Opera 11.5, I just tested on my server, Centos 6 and Moodle 2.1+ and it works fine. I also went to http://demo.moodle.net and after setting up file repo, I was able to log in and use it as admin, manager, teacher, and student to upload, download, and view pictures. Opera 11.5 just came out a few days ago...maybe try that???

            Show
            AL Rachels added a comment - Using Opera 11.5, I just tested on my server, Centos 6 and Moodle 2.1+ and it works fine. I also went to http://demo.moodle.net and after setting up file repo, I was able to log in and use it as admin, manager, teacher, and student to upload, download, and view pictures. Opera 11.5 just came out a few days ago...maybe try that???
            Hide
            Shevchenko Dmitry added a comment -

            Opera 11.5 just came out a few days ago
            I don't think the problem is in Opera version, since I used an old version of Opera and it still worked fine. The problem is caused by Moodle, and it seems the very latest versions don't suffer from this problem. Will check on my test server today.

            Philipp Pavelka: Opera still produce the same error for me
            Where do you get this error? I just registered there and tested the usage of filepicker for uploading a profile picture, and it worked fine. What version of Opera are you using?

            Show
            Shevchenko Dmitry added a comment - Opera 11.5 just came out a few days ago I don't think the problem is in Opera version, since I used an old version of Opera and it still worked fine. The problem is caused by Moodle, and it seems the very latest versions don't suffer from this problem. Will check on my test server today. Philipp Pavelka: Opera still produce the same error for me Where do you get this error? I just registered there and tested the usage of filepicker for uploading a profile picture, and it worked fine. What version of Opera are you using?
            Hide
            Alex added a comment - - edited

            I have latest Opera 11.50 and it still throws JSON error... Here in Ukraine and Russia more than 40% of users use Opera so this bug is really frustrating...

            Show
            Alex added a comment - - edited I have latest Opera 11.50 and it still throws JSON error... Here in Ukraine and Russia more than 40% of users use Opera so this bug is really frustrating...
            Hide
            Philipp Pavelka added a comment - - edited

            @Dmitry:
            I can reproduce this error with Opera 12 build 1033 on Win7 x86, Opera 11.50 build 1074 on Win XP and Mac OS X 10.6.8.
            What OS are you using with Opera?

            Edit:
            I can reproduce the error when I follow these steps:
            http://my.opera.com/community/forums/topic.dml?id=1060732

            Show
            Philipp Pavelka added a comment - - edited @Dmitry: I can reproduce this error with Opera 12 build 1033 on Win7 x86, Opera 11.50 build 1074 on Win XP and Mac OS X 10.6.8. What OS are you using with Opera? Edit: I can reproduce the error when I follow these steps: http://my.opera.com/community/forums/topic.dml?id=1060732
            Hide
            Shevchenko Dmitry added a comment -

            I am using Opera 9 on my notebook inside Windows Vista. As soon as I get home, I'll test their latest release on my home test server, and we'll see, does it really work or not.

            Show
            Shevchenko Dmitry added a comment - I am using Opera 9 on my notebook inside Windows Vista. As soon as I get home, I'll test their latest release on my home test server, and we'll see, does it really work or not.
            Hide
            Shevchenko Dmitry added a comment - - edited

            OK, so I tested it home. Deployed it on Apache 2.2.4 in Windows XP, PHP 5.3.6. In opera the latest stable release moodle 2.1 works fine, no error with file pickers.
            The previous stable version I used (2.0.2) does not work in Opera, it gives this error with JSON string. So I guess the problem is finally resolved in 2.1.
            @Philipp:
            I am not sure, what's wrong with your environment, maybe nothing and maybe somethings in Opera cache, but you should be able to use filepicker (at least for loading profile picture) on http://demo.moodle.net. If you still cannot, please report.

            Show
            Shevchenko Dmitry added a comment - - edited OK, so I tested it home. Deployed it on Apache 2.2.4 in Windows XP, PHP 5.3.6. In opera the latest stable release moodle 2.1 works fine, no error with file pickers. The previous stable version I used (2.0.2) does not work in Opera, it gives this error with JSON string. So I guess the problem is finally resolved in 2.1. @Philipp: I am not sure, what's wrong with your environment, maybe nothing and maybe somethings in Opera cache, but you should be able to use filepicker (at least for loading profile picture) on http://demo.moodle.net . If you still cannot, please report.
            Hide
            Philipp Pavelka added a comment -

            Still no chance here ;(
            I've just additionally tried to upload a profile picture on demo.moodle.net with a clean installation of Opera 11.50 on Debian 6.
            I get the same error message.

            Maybe I'm doing something wrong
            I perform the following steps to upload a profile pictue:
            1. login with a demo account
            2. go to My profile settings > Edit profile & under User picture select "Choose a file..."
            3. select "Upload a file"
            ....

            Show
            Philipp Pavelka added a comment - Still no chance here ;( I've just additionally tried to upload a profile picture on demo.moodle.net with a clean installation of Opera 11.50 on Debian 6. I get the same error message. Maybe I'm doing something wrong I perform the following steps to upload a profile pictue: 1. login with a demo account 2. go to My profile settings > Edit profile & under User picture select "Choose a file..." 3. select "Upload a file" ....
            Hide
            Dongsheng Cai added a comment -

            Hello guys

            filepicker uses YUI3 IO component to handle file uploading, the problem is filepicker get empty response, and failed to parse it, please see: http://yuilibrary.com/projects/yui3/ticket/2528752

            Show
            Dongsheng Cai added a comment - Hello guys filepicker uses YUI3 IO component to handle file uploading, the problem is filepicker get empty response, and failed to parse it, please see: http://yuilibrary.com/projects/yui3/ticket/2528752
            Hide
            Shevchenko Dmitry added a comment -

            @Cai
            Not sure that empty response has something to do with it. Why would that happen only inside Opera? Besides, I guess that the users pick up some file, so the response should not be empty.

            Show
            Shevchenko Dmitry added a comment - @Cai Not sure that empty response has something to do with it. Why would that happen only inside Opera? Besides, I guess that the users pick up some file, so the response should not be empty.
            Hide
            Dongsheng Cai added a comment -

            Shevchenko

            I was debugging on repository/filepicker.js, line 135, I print

            alert(o.responseText);
            

            Chrome, safari, firefox even ie can display the content of moodle response, this could be a problem of YUI3 library.

            Show
            Dongsheng Cai added a comment - Shevchenko I was debugging on repository/filepicker.js, line 135, I print alert(o.responseText); Chrome, safari, firefox even ie can display the content of moodle response, this could be a problem of YUI3 library.
            Hide
            Philipp Pavelka added a comment -

            This is what I get from Opera's Dragonfly.
            Maybe it helps.

            [04.08.2011 00:15:58] JavaScript - http://demo.moodle.net/user/edit.php?id=5&course=1
            Event thread: load
            Uncaught exception: TypeError: Cannot convert 'R.c' to object
            Error thrown at line 23, column 4390 in A(R, S) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/queue-promote/queue-promote-min.js&3.2.0/build/datatype/datatype-xml-min.js&3.2.0/build/io/io-min.js&3.2.0/build/json/json-parse-min.js:
                R.c.responseText=P?P.get("text"):O.get("text");
            called from line 23, column 5307 in <anonymous function>() in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/queue-promote/queue-promote-min.js&3.2.0/build/datatype/datatype-xml-min.js&3.2.0/build/io/io-min.js&3.2.0/build/json/json-parse-min.js:
                A(P,Q);
            called from line 42, column 95 in <anonymous function: _notify>(J, H, I) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js:
                G=this.fn.apply(J,F);
            called via Function.prototype.apply() from line 42, column 493 in <anonymous function: notify>(G, I) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js:
                F=this._notify(J,G,I);
            called from line 41, column 8690 in <anonymous function: _notify>(I, H, F) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js:
                G=I.notify(H,this);
            called from line 41, column 10229 in <anonymous function: _procSubs>(I, G, F) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js:
                if(false===this._notify(J,G,F))
            called from line 41, column 9716 in <anonymous function: fireSimple>(F) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js:
                this._procSubs(G[0],F);
            called from line 41, column 9317 in <anonymous function: fire>() in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js:
                return this.fireSimple(F);
            called from line 51, column 7458 in <anonymous function: v.fn>(A) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js:
                v.fire(k.getEvent(A,y,(t||(false===w))));
            called from unknown location in program code:
                /* no source available */
            
            

            Show
            Philipp Pavelka added a comment - This is what I get from Opera's Dragonfly. Maybe it helps. [04.08.2011 00:15:58] JavaScript - http://demo.moodle.net/user/edit.php?id=5&course=1 Event thread: load Uncaught exception: TypeError: Cannot convert 'R.c' to object Error thrown at line 23, column 4390 in A(R, S) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/queue-promote/queue-promote-min.js&3.2.0/build/datatype/datatype-xml-min.js&3.2.0/build/io/io-min.js&3.2.0/build/json/json-parse-min.js: R.c.responseText=P?P.get("text"):O.get("text"); called from line 23, column 5307 in <anonymous function>() in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/queue-promote/queue-promote-min.js&3.2.0/build/datatype/datatype-xml-min.js&3.2.0/build/io/io-min.js&3.2.0/build/json/json-parse-min.js: A(P,Q); called from line 42, column 95 in <anonymous function: _notify>(J, H, I) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js: G=this.fn.apply(J,F); called via Function.prototype.apply() from line 42, column 493 in <anonymous function: notify>(G, I) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js: F=this._notify(J,G,I); called from line 41, column 8690 in <anonymous function: _notify>(I, H, F) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js: G=I.notify(H,this); called from line 41, column 10229 in <anonymous function: _procSubs>(I, G, F) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js: if(false===this._notify(J,G,F)) called from line 41, column 9716 in <anonymous function: fireSimple>(F) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js: this._procSubs(G[0],F); called from line 41, column 9317 in <anonymous function: fire>() in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js: return this.fireSimple(F); called from line 51, column 7458 in <anonymous function: v.fn>(A) in http://demo.moodle.net/theme/yui_combo.php?3.2.0/build/yui/yui-base-min.js&3.2.0/build/oop/oop-min.js&3.2.0/build/dom/dom-min.js&3.2.0/build/yui/yui-later-min.js&3.2.0/build/event-custom/event-custom-base-min.js&3.2.0/build/event/event-base-min.js&3.2.0/build/pluginhost/pluginhost-min.js&3.2.0/build/event/event-delegate-min.js&3.2.0/build/node/node-min.js&3.2.0/build/yui/get-min.js&3.2.0/build/loader/loader-min.js: v.fire(k.getEvent(A,y,(t||(false===w)))); called from unknown location in program code: /* no source available */
            Hide
            Philipp Pavelka added a comment -

            I did a bit of debugging with Opera's Dragonfly.
            Like Dongsheng said the filepicker makes use of YUI3. The problem is that with Opera the response (respsonseText) ist empty.
            Apparently the problematic part in the code starts with the submit() function in the io scripts. In FF the script halts after the execution of submit() until the file is completely uploaded and proceeds afterwards.
            In Opera submit() starts the upload process and immediately proceeds with the code.
            This causes the empty response afterwards because the file isn't yet completely uploaded.

            I wrote a little fix which works for me.
            Unfortunately I don't know Javascript, hence the dirty solution.
            I simply pause the execution of the code for 4 seconds right after the submit() function. This leaves enough time for uploading small files. For bigger files you can raise the duration.

            Here is the code for the io-min.js in case someone wants to try it:
            http://pastebin.com/zsck2yZg

            Simply replace this code with the io-min.js in \lib\yui\3.2.0\build\io\ (assumed you have Debugging turned off).

            Unfortunately I didn't find out how to check if the upload has successfully completed.
            Sadly the submit() function doesn't return any status codes.

            Show
            Philipp Pavelka added a comment - I did a bit of debugging with Opera's Dragonfly. Like Dongsheng said the filepicker makes use of YUI3. The problem is that with Opera the response (respsonseText) ist empty. Apparently the problematic part in the code starts with the submit() function in the io scripts. In FF the script halts after the execution of submit() until the file is completely uploaded and proceeds afterwards. In Opera submit() starts the upload process and immediately proceeds with the code. This causes the empty response afterwards because the file isn't yet completely uploaded. I wrote a little fix which works for me. Unfortunately I don't know Javascript, hence the dirty solution. I simply pause the execution of the code for 4 seconds right after the submit() function. This leaves enough time for uploading small files. For bigger files you can raise the duration. Here is the code for the io-min.js in case someone wants to try it: http://pastebin.com/zsck2yZg Simply replace this code with the io-min.js in \lib\yui\3.2.0\build\io\ (assumed you have Debugging turned off). Unfortunately I didn't find out how to check if the upload has successfully completed. Sadly the submit() function doesn't return any status codes.
            Hide
            Shevchenko Dmitry added a comment - - edited

            I have done some investigation with this problem. It turned out that some of our users can use the filepicker with opera, and some cannot. But it does not depend on the opera version! It depends on the network location of the user.

            The user A (myself) tries to access the server using an USB modem for that - everything is fine. The opera console output is perfect, and the transaction response text is not empty.

            The user B (one of our teachers) tries to access the server and that teacher is located at LAN of another district - he gets the error, and the console output shows that the response text is empty.

            On my local server (then I use localhost) everything is fine with opera. So the question is - why the big difference.

            I asked the teacher to use my USB modem on his comp for testing. Then he uses the USB modem, Opera works fine with filepickers, otherwise it throws an error!

            @Philip: thanks for your debugging. I'll investigate your code and will try to merge it with our version to see if it works. Something's definitely wrong with opera handling the submit function. Since all other browsers are working fine with it, I can assume the function conforms to the standard, but the opera handling of submit (in some cases) does not.

            Show
            Shevchenko Dmitry added a comment - - edited I have done some investigation with this problem. It turned out that some of our users can use the filepicker with opera, and some cannot. But it does not depend on the opera version! It depends on the network location of the user. The user A (myself) tries to access the server using an USB modem for that - everything is fine. The opera console output is perfect, and the transaction response text is not empty. The user B (one of our teachers) tries to access the server and that teacher is located at LAN of another district - he gets the error, and the console output shows that the response text is empty. On my local server (then I use localhost) everything is fine with opera. So the question is - why the big difference. I asked the teacher to use my USB modem on his comp for testing. Then he uses the USB modem, Opera works fine with filepickers, otherwise it throws an error! @Philip: thanks for your debugging. I'll investigate your code and will try to merge it with our version to see if it works. Something's definitely wrong with opera handling the submit function. Since all other browsers are working fine with it, I can assume the function conforms to the standard, but the opera handling of submit (in some cases) does not.
            Hide
            Shevchenko Dmitry added a comment -

            This is the comparison of two different opera outputs that I have. The normal output is for USB modem (opera does not generate an error in that case), and the error output is for another LAN.

            Show
            Shevchenko Dmitry added a comment - This is the comparison of two different opera outputs that I have. The normal output is for USB modem (opera does not generate an error in that case), and the error output is for another LAN.
            Hide
            Philipp Pavelka added a comment -

            That's a really weird behavior having different results with only a different access to the Internet

            Show
            Philipp Pavelka added a comment - That's a really weird behavior having different results with only a different access to the Internet
            Hide
            Ces Mo added a comment -

            Same problem for me for moodle 2.1 but not linked to opera, since it happened with any browser IE, firefox, chrome etc...

            I have been testing the filepicker upload by 5 people located at 5 different places, 3 of them not working getting the Invalid JSON string, 2 of them working.

            There is nothing on the log that gives us any clue of a solution

            Show
            Ces Mo added a comment - Same problem for me for moodle 2.1 but not linked to opera, since it happened with any browser IE, firefox, chrome etc... I have been testing the filepicker upload by 5 people located at 5 different places, 3 of them not working getting the Invalid JSON string, 2 of them working. There is nothing on the log that gives us any clue of a solution
            Hide
            Shevchenko Dmitry added a comment - - edited

            @Ces Mo
            Great, but it gives us some statistics! Can you please tell what's the difference between all those locations? By the way, do you use an additional version of Moodle on 443 (for https) or not?

            Can you please post the info about those 5 locations without going in details in actual info, i.e.
            1. Is the person located in the same subnetwork with the server.
            2. Is the person accessing the server via proxy.
            3. Is there a firewall between them (or, if to be precisely, does the firewall on the server somehow filters and restricts the ip of this particular client).
            4. Version of opera for each location.
            5. Any additional info would be welcome.

            Show
            Shevchenko Dmitry added a comment - - edited @Ces Mo Great, but it gives us some statistics! Can you please tell what's the difference between all those locations? By the way, do you use an additional version of Moodle on 443 (for https) or not? Can you please post the info about those 5 locations without going in details in actual info, i.e. 1. Is the person located in the same subnetwork with the server. 2. Is the person accessing the server via proxy. 3. Is there a firewall between them (or, if to be precisely, does the firewall on the server somehow filters and restricts the ip of this particular client). 4. Version of opera for each location. 5. Any additional info would be welcome.
            Hide
            Shevchenko Dmitry added a comment -

            Additional info. Just found out something interesting. It seems like this problem may rise due to the fact of moodle settings. Here is why:
            1. On my local server, then I run the code with clear database (created by install in 2.0.2) opera does not throw an error.
            2. Then I run the SAME code with database upgraded from 1.9.10 (just changed the config.php), opera does throw an error.
            That means one of settings changed in the old database makes Opera act like that. In that case the raise of exception does not depend on the network location.
            However with standard clear database it can still throw an error due to the network location as Ces Mo pointed out. Need further investigation.

            Show
            Shevchenko Dmitry added a comment - Additional info. Just found out something interesting. It seems like this problem may rise due to the fact of moodle settings. Here is why: 1. On my local server, then I run the code with clear database (created by install in 2.0.2) opera does not throw an error. 2. Then I run the SAME code with database upgraded from 1.9.10 (just changed the config.php), opera does throw an error. That means one of settings changed in the old database makes Opera act like that. In that case the raise of exception does not depend on the network location. However with standard clear database it can still throw an error due to the network location as Ces Mo pointed out. Need further investigation.
            Hide
            Ces Mo added a comment -

            I m going to try to gives some details about the 5 users.

            One thing i want to mention is my plateform was upgrade from 1.9 -> 2 -> 2.1

            So this is not a clean new installation of moodle

            Show
            Ces Mo added a comment - I m going to try to gives some details about the 5 users. One thing i want to mention is my plateform was upgrade from 1.9 -> 2 -> 2.1 So this is not a clean new installation of moodle
            Hide
            Philipp Pavelka added a comment - - edited

            That's weird.. Uploading in Moodle 2.1 suddenly started to work here in a virtual WinXP XAMPP machine.
            So I decided to install another but a clean new Moodle instance on the same machine.
            After restarting the Apache service Opera again throws the error in both instances

            Edit:
            Uploading small files did now work again. Anything bigger would throw an error after ~4 secs.
            I cleared Opera's cache and cookies and it wouldn't let me upload even small files anymore.

            Show
            Philipp Pavelka added a comment - - edited That's weird.. Uploading in Moodle 2.1 suddenly started to work here in a virtual WinXP XAMPP machine. So I decided to install another but a clean new Moodle instance on the same machine. After restarting the Apache service Opera again throws the error in both instances Edit: Uploading small files did now work again. Anything bigger would throw an error after ~4 secs. I cleared Opera's cache and cookies and it wouldn't let me upload even small files anymore.
            Hide
            Shevchenko Dmitry added a comment -

            OK, there seems to be TWO problems inside this thing:

            1. One is with databases upgraded from 1.9. Those databases can be (potentially) set up strangely, and some setting in them makes Opera act weird, even on the local test server.
            2. Users connecting from strange locations. In that case even a clear instance won't work. I've set up on our university server two instances with the same code. Instance A is a clear one created from the scratch. Instance B is the upgraded one.
            2.1. Instance A can be accessed from Opera without errors on the server itself, from my USB modem, but a guy trying to access it from another district lan gets an error (so he switches to Mozilla).
            2.2. Instance B cannot be accessed from opera nowhere - not even on the server itself.

            As for the point 1, I think I can solve it in few days by comparing the settings of the clear database and the upgraded one, hope I find the solution. As for the second one, it's hard to test. I would be very grateful, if Ces Mo would provide additional info about the network location of his users.

            Show
            Shevchenko Dmitry added a comment - OK, there seems to be TWO problems inside this thing: 1. One is with databases upgraded from 1.9. Those databases can be (potentially) set up strangely, and some setting in them makes Opera act weird, even on the local test server. 2. Users connecting from strange locations. In that case even a clear instance won't work. I've set up on our university server two instances with the same code. Instance A is a clear one created from the scratch. Instance B is the upgraded one. 2.1. Instance A can be accessed from Opera without errors on the server itself, from my USB modem, but a guy trying to access it from another district lan gets an error (so he switches to Mozilla). 2.2. Instance B cannot be accessed from opera nowhere - not even on the server itself. As for the point 1, I think I can solve it in few days by comparing the settings of the clear database and the upgraded one, hope I find the solution. As for the second one, it's hard to test. I would be very grateful, if Ces Mo would provide additional info about the network location of his users.
            Hide
            Alexey Guseynov added a comment -

            Please notice comment by Philipp Pavelka. I'm pretty sure, that network location and upgrade status DO NOT MATTER. Time does. Philipp has found the problem place. I can't upload nearly any file with opera, but I can upload very small file. this means that if upload is fast - it succeeds.
            You have fast network access with low - you success. You have fast LAN but packets go around the Earth to reach nearest building - you fail.

            Show
            Alexey Guseynov added a comment - Please notice comment by Philipp Pavelka. I'm pretty sure, that network location and upgrade status DO NOT MATTER. Time does. Philipp has found the problem place. I can't upload nearly any file with opera, but I can upload very small file. this means that if upload is fast - it succeeds. You have fast network access with low - you success. You have fast LAN but packets go around the Earth to reach nearest building - you fail.
            Hide
            Philipp Pavelka added a comment -

            It would be nice to know how big the size of the successfully uploaded files was.

            Show
            Philipp Pavelka added a comment - It would be nice to know how big the size of the successfully uploaded files was.
            Hide
            Philipp Pavelka added a comment - - edited

            I played around again with Opera's debugger.
            I'm starting to think it's an Opera bug.

            Adding a breakpoint at a specific line with a condition that doesn't even fire surprisingly causes Opera to successfully upload any file although the script never halts.

            Here's how to reproduce this behaviour:

            • Within Moodle disable YUI combo loading and probably also Cache Javascript under Site administration>Appearance>AJAX and Javascript
            • tidy up the node-min.js (in case Moodle debugging is disabled) in order to make the code better readable (I've use the JSMin plugin for Notepad++ to format the code)
            • open Opera's debugger
            • select the node-min.js script
            • add a breakpoint within the function "H.scrubVal = function (M, L)"
            • add a condition which doesn't fire
            • upload a file

            The debugger doesn't halt the script execution and Opera doesn't throw an error and the files get successfully uploaded.
            Disable the breakpoint -> Opera also doesn't halt the script but throws an error.

            Adding a breakpoint with a condition that makes the execution halt at the point also doesn't throw an error. Interestingly in this case Opera waits until the file has been completely uploaded an then halts at the breakpoint.

            I've observed this behaviour with Opera 12 and Opera 11.51 on Win7 x86.

            Because a video says more than a thousand words:
            http://www.screencast.com/t/2nCYj8s9Kzr

            Another thing here I've noticed:
            Opera throws an JSON error here with the small file but apparently the file has been successfully uploaded because later on with the breakpoint set I get asked whether I want to overwrite or rename the file.

            Edit:
            I've just reproduced the same behaviour on Mac OS X and Opera 11.51.
            I don't know why this is happening but I suppose it shouldn't be that way.

            Edit2:
            Apparently in the latest 2.2 builds YUI has been updated from 3.2.0 to 3.4.0. The problem still persists here and you can still reproduce this behaviour but instead of the node-min.js the node-core-min.js (lib\yui\3.4.0\build\node-core) is being loaded. Add the breakpoint here in the k.scrubVal method.

            Show
            Philipp Pavelka added a comment - - edited I played around again with Opera's debugger. I'm starting to think it's an Opera bug. Adding a breakpoint at a specific line with a condition that doesn't even fire surprisingly causes Opera to successfully upload any file although the script never halts. Here's how to reproduce this behaviour: Within Moodle disable YUI combo loading and probably also Cache Javascript under Site administration>Appearance>AJAX and Javascript tidy up the node-min.js (in case Moodle debugging is disabled) in order to make the code better readable (I've use the JSMin plugin for Notepad++ to format the code) open Opera's debugger select the node-min.js script add a breakpoint within the function "H.scrubVal = function (M, L)" add a condition which doesn't fire upload a file The debugger doesn't halt the script execution and Opera doesn't throw an error and the files get successfully uploaded. Disable the breakpoint -> Opera also doesn't halt the script but throws an error. Adding a breakpoint with a condition that makes the execution halt at the point also doesn't throw an error. Interestingly in this case Opera waits until the file has been completely uploaded an then halts at the breakpoint. I've observed this behaviour with Opera 12 and Opera 11.51 on Win7 x86. Because a video says more than a thousand words: http://www.screencast.com/t/2nCYj8s9Kzr Another thing here I've noticed: Opera throws an JSON error here with the small file but apparently the file has been successfully uploaded because later on with the breakpoint set I get asked whether I want to overwrite or rename the file. Edit: I've just reproduced the same behaviour on Mac OS X and Opera 11.51. I don't know why this is happening but I suppose it shouldn't be that way. Edit2: Apparently in the latest 2.2 builds YUI has been updated from 3.2.0 to 3.4.0. The problem still persists here and you can still reproduce this behaviour but instead of the node-min.js the node-core-min.js (lib\yui\3.4.0\build\node-core) is being loaded. Add the breakpoint here in the k.scrubVal method.
            Hide
            Mart Mangus added a comment -

            I tried this "breakpoint technique" with following code added to /lib/yui/3.4.1/build/node-core/node-core-min.js:

            k.scrubVal=function(r,q){
             
            if (notExistingVariable==1)
            <breakpoint here>  alert('opera test');
             
            if(r){if(typeof r=="object"||typeof r=="function")
            

            But couldn't still upload the file.
            I could only crash Opera (Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.9.168 Version/11.52) multiple times during this test.

            Philipp, what code did You use in Your testing and do You still think it can be a bug in Opera?

            Show
            Mart Mangus added a comment - I tried this "breakpoint technique" with following code added to /lib/yui/3.4.1/build/node-core/node-core-min.js: k.scrubVal=function(r,q){ if (notExistingVariable==1) <breakpoint here> alert('opera test'); if(r){if(typeof r=="object"||typeof r=="function") But couldn't still upload the file. I could only crash Opera (Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.9.168 Version/11.52) multiple times during this test. Philipp, what code did You use in Your testing and do You still think it can be a bug in Opera?
            Hide
            Philipp Pavelka added a comment -

            Mart did you actually add those lines within the node-core-min.js on the server?
            What I've done was to add a breakpoint with a condition in Opera's debugging tool Dragonfly.

            I've tried it again with Moodle 2.1.2+ (Build: 20111115) and Opera 12 (build 1155) on Win7 x64 and still could reproduce my described behaviour.
            What's strange is that I need now to add at least two breakpoints with (non firing) conditions in order to successfully complete the upload process.
            I've took /lib/yui/3.4.1/build/node-core/node-core-min.js, reformatted it with http://jsbeautifier.org/ and in Dragonfly I've added breakpoints to lines 82 and 83 with the condition 'r == "blah"' each.

            Yeah, I still think there's something buggy with Opera's Javascript engine.

            Show
            Philipp Pavelka added a comment - Mart did you actually add those lines within the node-core-min.js on the server? What I've done was to add a breakpoint with a condition in Opera's debugging tool Dragonfly. I've tried it again with Moodle 2.1.2+ (Build: 20111115) and Opera 12 (build 1155) on Win7 x64 and still could reproduce my described behaviour. What's strange is that I need now to add at least two breakpoints with (non firing) conditions in order to successfully complete the upload process. I've took /lib/yui/3.4.1/build/node-core/node-core-min.js, reformatted it with http://jsbeautifier.org/ and in Dragonfly I've added breakpoints to lines 82 and 83 with the condition 'r == "blah"' each. Yeah, I still think there's something buggy with Opera's Javascript engine.
            Hide
            Mart Mangus added a comment - - edited

            Mart did you actually add those lines within the node-core-min.js on the server?

            Yes.

            Tried again with formatted node-core-min.js, but still could not upload the file like that.
            Maybe it's because of different version of Opera (Windows vs Linux).

            Has anyone else tested this "breakpoint technique" under any operating system?
            With success?

            Show
            Mart Mangus added a comment - - edited Mart did you actually add those lines within the node-core-min.js on the server? Yes. Tried again with formatted node-core-min.js, but still could not upload the file like that. Maybe it's because of different version of Opera (Windows vs Linux). Has anyone else tested this "breakpoint technique" under any operating system? With success?
            Hide
            Philipp Pavelka added a comment -

            Did you use Opera's Dragonfly to add the breakpoints as shown in my above screencast?

            This is not a resolution for the JSON problem nor a workaround since I just want to show that Opera's JS engine is working somehow cheesy in that way that I can get Opera to successfully upload files each time with my described steps without problems.
            Adding conditional breakpoints in the debugger which do not even halt weirdly solves the problem.

            Keep in mind that my described workaround occurs only within the browser itself and serves primarily only a "proof of concept" to show that IMHO the bug is buried within Opera.

            Anyway I'm also interested if anyone else can reproduce my experiences.

            At least there's apparently someone from the Opera team looking into this issue.

            Show
            Philipp Pavelka added a comment - Did you use Opera's Dragonfly to add the breakpoints as shown in my above screencast ? This is not a resolution for the JSON problem nor a workaround since I just want to show that Opera's JS engine is working somehow cheesy in that way that I can get Opera to successfully upload files each time with my described steps without problems. Adding conditional breakpoints in the debugger which do not even halt weirdly solves the problem. Keep in mind that my described workaround occurs only within the browser itself and serves primarily only a "proof of concept" to show that IMHO the bug is buried within Opera. Anyway I'm also interested if anyone else can reproduce my experiences. At least there's apparently someone from the Opera team looking into this issue.
            Hide
            Mart Mangus added a comment -

            Did you use Opera's Dragonfly to add the breakpoints as shown in my above screencast?

            Oh, now i saw the screencast – i did not understand that You meant conditional breakpoint in Opera!
            But even that did not make Opera file upload work on my Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.9.168 Version/11.52

            Show
            Mart Mangus added a comment - Did you use Opera's Dragonfly to add the breakpoints as shown in my above screencast? Oh, now i saw the screencast – i did not understand that You meant conditional breakpoint in Opera! But even that did not make Opera file upload work on my Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.9.168 Version/11.52
            Hide
            Gerard Caulfield added a comment -

            Reproduced on http://demo.moodle.net/user/filesedit.php using:

            Opera
            Version 11.60
            Build 1185
            Platform Linux
            System x86_64, 2.6.32-35-generic
            Browser identification Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.10.229 Version/11.60

            Show
            Gerard Caulfield added a comment - Reproduced on http://demo.moodle.net/user/filesedit.php using: Opera Version 11.60 Build 1185 Platform Linux System x86_64, 2.6.32-35-generic Browser identification Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.10.229 Version/11.60
            Hide
            Vicente Jiménez Aguilar added a comment -

            I just wanted to inform that I resolved this issue after increasing the PHP memory limit to 512M.

            I don't know if is possible to improve the memory usage, if this is a memory leak or this process really needs all that memory.

            In my case, it was trying to list a very large course imported from version 1.9.
            And I found that the wrong JSON was due to a empty string because the request get cancelled (Saw it in Firebug).

            Maybe it is possible to catch that even (request cancellation) and print a more informative message like:
            "Response canceled by server. Check PHP memory limit."

            In my case, this error was due to a memory limit reached.
            This same "invalid JSON" message could be due to a set of different problems.

            Show
            Vicente Jiménez Aguilar added a comment - I just wanted to inform that I resolved this issue after increasing the PHP memory limit to 512M. I don't know if is possible to improve the memory usage, if this is a memory leak or this process really needs all that memory. In my case, it was trying to list a very large course imported from version 1.9. And I found that the wrong JSON was due to a empty string because the request get cancelled (Saw it in Firebug). Maybe it is possible to catch that even (request cancellation) and print a more informative message like: "Response canceled by server. Check PHP memory limit." In my case, this error was due to a memory limit reached. This same "invalid JSON" message could be due to a set of different problems.
            Hide
            Philipp Pavelka added a comment -

            Thanks for your insights!

            Unfortunately increasing the memory limit didn't help in my case.

            Show
            Philipp Pavelka added a comment - Thanks for your insights! Unfortunately increasing the memory limit didn't help in my case.
            Hide
            Mart Mangus added a comment -

            PHP memory limit increase to 512M did not make the file upload to work in Opera in our case also.

            Show
            Mart Mangus added a comment - PHP memory limit increase to 512M did not make the file upload to work in Opera in our case also.
            Hide
            Martin Samek added a comment -

            Negative, memory limit increase didn't make it. Tested on same system and connectivity. Chromium uploads file without any problem, at the same moment Opera fails with Invalid JSON string. Any idea?

            Show
            Martin Samek added a comment - Negative, memory limit increase didn't make it. Tested on same system and connectivity. Chromium uploads file without any problem, at the same moment Opera fails with Invalid JSON string. Any idea?
            Hide
            Brian King added a comment -

            I'm also seeing this issue with Opera 11.62 and Moodle 2.2.2+ (Build: 20120329).

            Show
            Brian King added a comment - I'm also seeing this issue with Opera 11.62 and Moodle 2.2.2+ (Build: 20120329).
            Hide
            Vadim Dvorovenko added a comment -

            The problem is in conflict in Opera and YUI 3.4.1, described here http://yuilibrary.com/projects/yui3/ticket/2531217
            The solution is to upgrade from YUI 3.4.1 to 3.5.0 or later
            Latest 2.3dev have yui 3.5.0 and this bug is fixed
            Patch for 2.2.2 based on https://github.com/dpobel/yui3/commit/1a8b46c524b8ceb36f06d544c1c1c6f6436b3152 can be found here
            https://github.com/vadimonus/moodle/commit/a63de07e297e355152acfa2befd54906a1bd1b25

            Show
            Vadim Dvorovenko added a comment - The problem is in conflict in Opera and YUI 3.4.1, described here http://yuilibrary.com/projects/yui3/ticket/2531217 The solution is to upgrade from YUI 3.4.1 to 3.5.0 or later Latest 2.3dev have yui 3.5.0 and this bug is fixed Patch for 2.2.2 based on https://github.com/dpobel/yui3/commit/1a8b46c524b8ceb36f06d544c1c1c6f6436b3152 can be found here https://github.com/vadimonus/moodle/commit/a63de07e297e355152acfa2befd54906a1bd1b25
            Hide
            Philipp Pavelka added a comment -

            If you didn't see it yet, there's also probably an internal fix in Opera's core. Hopefully it will be released to the public in the near future. The fix will be recognizable as CORE-44712 in the changelog.
            (Reference)

            Show
            Philipp Pavelka added a comment - If you didn't see it yet, there's also probably an internal fix in Opera's core. Hopefully it will be released to the public in the near future. The fix will be recognizable as CORE-44712 in the changelog. ( Reference )
            Hide
            Vadim Dvorovenko added a comment -

            I'm using latest stable Opera, but still can not upload files to moodle.org. In addition we should keep thinking about users that does not use latest opera, so solution with patching or updating YUI is preffered. As far as some percent of users uses opera I think we should patch all stable moodle versions, besides the patch is very simple.
            patch for 2.1 here https://github.com/vadimonus/moodle/commit/97474c6fee120c4f921491572400ea132b125ca0

            Show
            Vadim Dvorovenko added a comment - I'm using latest stable Opera, but still can not upload files to moodle.org. In addition we should keep thinking about users that does not use latest opera, so solution with patching or updating YUI is preffered. As far as some percent of users uses opera I think we should patch all stable moodle versions, besides the patch is very simple. patch for 2.1 here https://github.com/vadimonus/moodle/commit/97474c6fee120c4f921491572400ea132b125ca0
            Hide
            Vadim Dvorovenko added a comment - - edited

            -

            Show
            Vadim Dvorovenko added a comment - - edited -
            Hide
            Philipp Pavelka added a comment -

            I totally agree!
            It's not clear how long it will take until Opera's fix will be integrated into a public build. It definitely will still take a while and it's not sure if the fix will really apply to this specific issue.

            Show
            Philipp Pavelka added a comment - I totally agree! It's not clear how long it will take until Opera's fix will be integrated into a public build. It definitely will still take a while and it's not sure if the fix will really apply to this specific issue.
            Hide
            Sam Hemelryk added a comment -

            Hi Dongsheng,

            I was in two minds about this originally but have swung around and do think this backport of a YUI issue is going to be the best solution.
            Could you please add a note to lib/yui/readme_moodle.txt explaining we've backported a fix that will has been introduced in 3.5.0 and provide a link to the YUI issue.
            Once done this can be put up for integration.

            Cheers
            Sam

            Show
            Sam Hemelryk added a comment - Hi Dongsheng, I was in two minds about this originally but have swung around and do think this backport of a YUI issue is going to be the best solution. Could you please add a note to lib/yui/readme_moodle.txt explaining we've backported a fix that will has been introduced in 3.5.0 and provide a link to the YUI issue. Once done this can be put up for integration. Cheers Sam
            Hide
            Dongsheng Cai added a comment -

            Hi Sam

            Are you going to apply Vadim or backport YUI3.5 to moodle 2.2?

            Show
            Dongsheng Cai added a comment - Hi Sam Are you going to apply Vadim or backport YUI3.5 to moodle 2.2?
            Hide
            Sam Hemelryk added a comment -

            Hi Dongsheng,

            I had thought about backporting YUI 3.5 to 2.2 and certainly it is one possibility.
            However this is a pretty contained issue and I'm not familiar enough with what is changing with YUI to know about the consequences of such a backport.
            I've added Petr as a watcher here as no doubt he will have a much better understanding than me (I've also added other integrators).
            Presently I think we should be applying this patch and just noting the alteration in lib/yui/readme_moodle.txt

            Petr + integrators what are your thoughts?

            Cheers
            Sam

            Show
            Sam Hemelryk added a comment - Hi Dongsheng, I had thought about backporting YUI 3.5 to 2.2 and certainly it is one possibility. However this is a pretty contained issue and I'm not familiar enough with what is changing with YUI to know about the consequences of such a backport. I've added Petr as a watcher here as no doubt he will have a much better understanding than me (I've also added other integrators). Presently I think we should be applying this patch and just noting the alteration in lib/yui/readme_moodle.txt Petr + integrators what are your thoughts? Cheers Sam
            Hide
            Petr Skoda added a comment -

            Hmm, we did not modify yui before and I dod not think we should now because it does not work for sites using external YUI from CDN. Upgrading to 3.5.x seems scary to me, risking breakages for majority of people. Could there be a way to patch the YUI class on the fly in browser only? Are there any other places apart from File picker that are affected by this problem?

            Show
            Petr Skoda added a comment - Hmm, we did not modify yui before and I dod not think we should now because it does not work for sites using external YUI from CDN. Upgrading to 3.5.x seems scary to me, risking breakages for majority of people. Could there be a way to patch the YUI class on the fly in browser only? Are there any other places apart from File picker that are affected by this problem?
            Hide
            Aparup Banerjee added a comment -

            if its the yui modification - my -1 for stability is compromised in too many places, if we're talking about the backport of the better yui version, i think +1 as long as the yui we're backporting has been tested in some release already.

            Show
            Aparup Banerjee added a comment - if its the yui modification - my -1 for stability is compromised in too many places, if we're talking about the backport of the better yui version, i think +1 as long as the yui we're backporting has been tested in some release already.
            Hide
            Petr Skoda added a comment - - edited

            YUI 3.5.x is not compatible with moodle 2.2.x, we had to tweak loaders in master, but it is still not fully tested there and the codebase diverged enough to require separate testing in 2.2.x.

            Show
            Petr Skoda added a comment - - edited YUI 3.5.x is not compatible with moodle 2.2.x, we had to tweak loaders in master, but it is still not fully tested there and the codebase diverged enough to require separate testing in 2.2.x.
            Hide
            Gordon Bateson added a comment - - edited

            The "Invalid JSON string" error still persists in latest Moodle 2.3dev (Build: 20120522) when trying to upload a file with file picker. YUI version seems to be 3.5.1.

            Server: Win2003, PHP 5.3.2, MySQL 5.1.48
            Browsers tested: FF(Win) 12.0 and IE 8.0

            This is no error using same browsers to upload files to latest Moodle 2.2.3+ (Build: 20120519) on same server. Moodle 2.2.3+ seems to be using YUI 3.4.1

            Show
            Gordon Bateson added a comment - - edited The "Invalid JSON string" error still persists in latest Moodle 2.3dev (Build: 20120522) when trying to upload a file with file picker. YUI version seems to be 3.5.1. Server: Win2003, PHP 5.3.2, MySQL 5.1.48 Browsers tested: FF(Win) 12.0 and IE 8.0 This is no error using same browsers to upload files to latest Moodle 2.2.3+ (Build: 20120519) on same server. Moodle 2.2.3+ seems to be using YUI 3.4.1
            Hide
            Philipp Pavelka added a comment -

            Today's Opera's build mentions the bug fix CORE-44712 in its changelog but unfortunately it doesn't fix this problem as hoped.

            Show
            Philipp Pavelka added a comment - Today's Opera's build mentions the bug fix CORE-44712 in its changelog but unfortunately it doesn't fix this problem as hoped.
            Hide
            Derek Chirnside added a comment -

            This is the screenshot I got. 20120525, 2.2.3+ Debian

            Tried to upload a zip file 65Meg (Hung) then with some smaller files (eg 1.6Meg) got this. Also with 1.6Meg JPG, 3Meg PDF, but Not a tiny JPG.

            Show
            Derek Chirnside added a comment - This is the screenshot I got. 20120525, 2.2.3+ Debian Tried to upload a zip file 65Meg (Hung) then with some smaller files (eg 1.6Meg) got this. Also with 1.6Meg JPG, 3Meg PDF, but Not a tiny JPG.
            Hide
            Derek Chirnside added a comment -

            [OK, the JIRA database refreshed mid post] see the screenshot above, I have not seen the detail of the message like tyhis before, usually I only get a small message, and usually, up until now this has been completely unpredicatable. Now it is consistent.

            -Derek

            Show
            Derek Chirnside added a comment - [OK, the JIRA database refreshed mid post] see the screenshot above, I have not seen the detail of the message like tyhis before, usually I only get a small message, and usually, up until now this has been completely unpredicatable. Now it is consistent. -Derek
            Hide
            Philipp Pavelka added a comment -
            Show
            Philipp Pavelka added a comment - Seems like there's an Opera fix on the way: http://my.opera.com/community/forums/topic.dml?id=1060732&t=1339106503&page=1#comment12423762
            Hide
            Richard Heath added a comment - - edited

            [comment removed - ignore me!]

            Show
            Richard Heath added a comment - - edited [comment removed - ignore me!]
            Hide
            Philipp Pavelka added a comment -

            The problem is now fixed for me with the latest Opera 12 final version.
            Maybe someone can confirm.

            Show
            Philipp Pavelka added a comment - The problem is now fixed for me with the latest Opera 12 final version. Maybe someone can confirm.
            Hide
            Ryan Smith added a comment -

            Confirmed here...the file picker now works correctly with Opera 12.00.

            Show
            Ryan Smith added a comment - Confirmed here...the file picker now works correctly with Opera 12.00.
            Hide
            Dan Poltawski added a comment -

            Is anyone reporting this issue in anything but Opera?

            Show
            Dan Poltawski added a comment - Is anyone reporting this issue in anything but Opera?
            Hide
            Gordon Bateson added a comment -

            Dan, I had the "Invalid JSON string" error a few of weeks back in FF 12(Win) and IE 8, but I don't get the message with those browsers and the most recent Moodle 2.3+. Seems to be fixed from my point of view.

            Show
            Gordon Bateson added a comment - Dan, I had the "Invalid JSON string" error a few of weeks back in FF 12(Win) and IE 8, but I don't get the message with those browsers and the most recent Moodle 2.3+. Seems to be fixed from my point of view.
            Hide
            Carola Brunnbauer added a comment -

            We have two different cases with FF (starting with 12.0) in Moodle 2.2.2+ , at the moment only concerning pdf.

            Show
            Carola Brunnbauer added a comment - We have two different cases with FF (starting with 12.0) in Moodle 2.2.2+ , at the moment only concerning pdf.
            Hide
            Jeffrey L. Jones added a comment - - edited

            I'm getting the error with IE 9, uploading videos over 30 meg, Moodle 2.2.3, W2008 + IIS 7.5. I'm off to see if IIS size/timeout settings help.

            Show
            Jeffrey L. Jones added a comment - - edited I'm getting the error with IE 9, uploading videos over 30 meg, Moodle 2.2.3, W2008 + IIS 7.5. I'm off to see if IIS size/timeout settings help.
            Hide
            Robert Silvie II added a comment -

            If you're running Moodle on Win2008 and IIS 7x, you need to add this to your web.config file to prevent the Invalid JSON string on filepicker message from showing up.

                <system.webServer>
                    <security>
                        <requestFiltering>
                            <requestLimits maxAllowedContentLength="262144000" />
                        </requestFiltering>
                    </security>
                </system.webServer>
            

            Show
            Robert Silvie II added a comment - If you're running Moodle on Win2008 and IIS 7x, you need to add this to your web.config file to prevent the Invalid JSON string on filepicker message from showing up. < system .webServer> < security > < requestFiltering > < requestLimits maxAllowedContentLength = "262144000" /> </ requestFiltering > </ security > </ system .webServer>
            Hide
            Jeffrey L. Jones added a comment -

            Thanks. My server geek set it in the IIS GUI...problem solved.

            Show
            Jeffrey L. Jones added a comment - Thanks. My server geek set it in the IIS GUI...problem solved.
            Hide
            Mary Evans added a comment -

            I have just come across this problem for the very first time ever!
            Moodle Version: $release = '2.3rc1 (Build: 20120624)
            Theme: Rocket(latest version)
            Browser: FireFox 13.0.1
            OS: Win7
            Localhost: WAMPServer2.1 (PHP 5.3.4; MySQL 5.1.53; Apache 2.2.17)

            Show
            Mary Evans added a comment - I have just come across this problem for the very first time ever! Moodle Version: $release = '2.3rc1 (Build: 20120624) Theme: Rocket(latest version) Browser: FireFox 13.0.1 OS: Win7 Localhost: WAMPServer2.1 (PHP 5.3.4; MySQL 5.1.53; Apache 2.2.17)
            Hide
            Michael Woods added a comment - - edited

            I'm also getting this for the very first time, in stable 2.3 (20120625). This morning, I was getting it on any repository I clicked on from the left hand menu. However, now I can only trigger it by clicking the tree-view display on Server Files, and only as a teacher role (not as an admin).

            I'm using Google Chrome on a Win7 machine.

            Has something changed in recent builds?

            Show
            Michael Woods added a comment - - edited I'm also getting this for the very first time, in stable 2.3 (20120625). This morning, I was getting it on any repository I clicked on from the left hand menu. However, now I can only trigger it by clicking the tree-view display on Server Files, and only as a teacher role (not as an admin). I'm using Google Chrome on a Win7 machine. Has something changed in recent builds?
            Hide
            Dan Poltawski added a comment -

            Hi,

            If you see this error, please can you check the error console if in file manager, the error should be output there.

            If in filepicker the actual error should be in the filepicker window behind the error message.

            Note that unfortunately this 'invalid JSON string' is a generic 'there was a problem' error so there could be many different things going on here, so if you can get the actual error then that is important.

            Show
            Dan Poltawski added a comment - Hi, If you see this error, please can you check the error console if in file manager, the error should be output there. If in filepicker the actual error should be in the filepicker window behind the error message. Note that unfortunately this 'invalid JSON string' is a generic 'there was a problem' error so there could be many different things going on here, so if you can get the actual error then that is important.
            Hide
            Michael Woods added a comment -

            Hi Dan,

            I'm getting the error message below. So is it a server configuration issue (lack of memory)?

            -------
            Invalid JSON string
            Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 143493 bytes) in /mnt/moodle/moodle2b/lib/dml/mysqli_native_moodle_database.php on line 868
            -------

            Regards,
            Michael

            Show
            Michael Woods added a comment - Hi Dan, I'm getting the error message below. So is it a server configuration issue (lack of memory)? ------- Invalid JSON string Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 143493 bytes) in /mnt/moodle/moodle2b/lib/dml/mysqli_native_moodle_database.php on line 868 ------- Regards, Michael
            Hide
            Dan Poltawski added a comment -

            Thanks Michael, your bug has been reported and is waiting for integraiton review in MDL-33857, it'd be great if you are able to try that patch out to see if it fixes your problem too.

            Show
            Dan Poltawski added a comment - Thanks Michael, your bug has been reported and is waiting for integraiton review in MDL-33857 , it'd be great if you are able to try that patch out to see if it fixes your problem too.
            Hide
            Vadim Dvorovenko added a comment - - edited

            The problem caused by opera is not actual since Opera 12 in 2.2, and it's not actual for 2.3 at all.
            I've recently found solution, that causes normal upload behaviour.
            Unfortunately, i've found it only now, when solution is not so actual as one year ago. But i think we should update moodle 2.2 for users that still uses old opera.
            https://github.com/vadimonus/moodle/commit/bef899b1208f943b5e1cd083f924c98fecdd730a

            Testing instructions.
            Setup lates moodle 2.2.
            Download some old opera from http://arc.opera.com/pub/opera/win/
            Install it in usb flash mode if you have other opera installed
            Create new file resourse, try to upload file, get error.
            Apply patch.Check for normal behaviour.

            Show
            Vadim Dvorovenko added a comment - - edited The problem caused by opera is not actual since Opera 12 in 2.2, and it's not actual for 2.3 at all. I've recently found solution, that causes normal upload behaviour. Unfortunately, i've found it only now, when solution is not so actual as one year ago. But i think we should update moodle 2.2 for users that still uses old opera. https://github.com/vadimonus/moodle/commit/bef899b1208f943b5e1cd083f924c98fecdd730a Testing instructions. Setup lates moodle 2.2. Download some old opera from http://arc.opera.com/pub/opera/win/ Install it in usb flash mode if you have other opera installed Create new file resourse, try to upload file, get error. Apply patch.Check for normal behaviour.
            Hide
            Matt Seymour added a comment - - edited

            Hi,

            I am also experiencing this issue with Moodle 2.2.3 using IIS 7.5 and MySQL and Server 2008 R2.

            I'm seeing this error in FF 13.0.1 and IE9.

            I have modified the max file size etc in PHP and increased content length in IIS.

            Going to upgrade to latest 2.3 +

            Matt

            Show
            Matt Seymour added a comment - - edited Hi, I am also experiencing this issue with Moodle 2.2.3 using IIS 7.5 and MySQL and Server 2008 R2. I'm seeing this error in FF 13.0.1 and IE9. I have modified the max file size etc in PHP and increased content length in IIS. Going to upgrade to latest 2.3 + Matt
            Hide
            Matt Seymour added a comment -

            HI All,

            I have now upgraded to 2.3 + and it has solved the error.

            Thanks

            Show
            Matt Seymour added a comment - HI All, I have now upgraded to 2.3 + and it has solved the error. Thanks
            Hide
            Carola Brunnbauer added a comment -

            Unfortunately in our case the update to 2.3 only solved the problem by using the drag&drop-upload. With the filepicker some useres still get the error message (latest FF).

            Show
            Carola Brunnbauer added a comment - Unfortunately in our case the update to 2.3 only solved the problem by using the drag&drop-upload. With the filepicker some useres still get the error message (latest FF).
            Hide
            James Cracknell added a comment -

            In 2.3 I like Mary get the error using Rocket as a theme - but with other themes no error.

            Odd.

            Browser makes no difference. IIS7.5 PostgreSQL db.

            Show
            James Cracknell added a comment - In 2.3 I like Mary get the error using Rocket as a theme - but with other themes no error. Odd. Browser makes no difference. IIS7.5 PostgreSQL db.
            Hide
            Carola Brunnbauer added a comment -

            In our case the error occurs with the Arialist theme.

            Show
            Carola Brunnbauer added a comment - In our case the error occurs with the Arialist theme.
            Hide
            Aparup Banerjee added a comment -

            i think i've seen this happen to me too. not sure who's really working on this but i'm dragging this into the next planned sprint now and grabbing this.

            Show
            Aparup Banerjee added a comment - i think i've seen this happen to me too. not sure who's really working on this but i'm dragging this into the next planned sprint now and grabbing this.
            Hide
            Andrew C added a comment - - edited

            Hi Everyone, have you checked your web server configuration? Upload limit conflicts with Moodle/web server can cause this problem.

            Show
            Andrew C added a comment - - edited Hi Everyone, have you checked your web server configuration? Upload limit conflicts with Moodle/web server can cause this problem.
            Hide
            Susan Mangan added a comment -

            I just upgraded our development server to 2.3.1 and this is the first I've seen of this error since we've been running 2x. We were running v2.2 since January and didn't see it once.

            I now get this error when I go into the filepicker and click on Server Files using FF and IE.

            Debugging msg: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 60775 bytes) in /var/www/moodle/lib/dml/mysqli_native_moodle_database.php on line 868

            Show
            Susan Mangan added a comment - I just upgraded our development server to 2.3.1 and this is the first I've seen of this error since we've been running 2x. We were running v2.2 since January and didn't see it once. I now get this error when I go into the filepicker and click on Server Files using FF and IE. Debugging msg: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 60775 bytes) in /var/www/moodle/lib/dml/mysqli_native_moodle_database.php on line 868
            Hide
            Dan Poltawski added a comment -

            Hi Susan,

            That issue is reported as MDL-33857

            Show
            Dan Poltawski added a comment - Hi Susan, That issue is reported as MDL-33857
            Hide
            Susan Mangan added a comment -

            Great, thanks for letting me know

            Show
            Susan Mangan added a comment - Great, thanks for letting me know
            Hide
            Michael de Raadt added a comment -

            Aparup is now working on another project.

            Hopefully we will be able to complete what he started in an upcoming sprint.

            Show
            Michael de Raadt added a comment - Aparup is now working on another project. Hopefully we will be able to complete what he started in an upcoming sprint.
            Hide
            Andrea Gregory (Gordon) added a comment -

            Hi All

            I have come across this and found it to be the HTTPS logins enabled also as Jason has said:

            "Looks like this issue is caused when you have HTTPS login enabled, but your WWWROOT set to "http://". It seems like the "require_login()" function is causing the problem on my end where it cannot detect the $USER object."

            Any ideas how to resolve this? I have tested with https logins switched off and it works fine so this is definitely the issue.. for me in this instance anyway

            Thank you!

            Andrea

            Show
            Andrea Gregory (Gordon) added a comment - Hi All I have come across this and found it to be the HTTPS logins enabled also as Jason has said: "Looks like this issue is caused when you have HTTPS login enabled, but your WWWROOT set to "http://". It seems like the "require_login()" function is causing the problem on my end where it cannot detect the $USER object." Any ideas how to resolve this? I have tested with https logins switched off and it works fine so this is definitely the issue.. for me in this instance anyway Thank you! Andrea
            Hide
            Rajesh Taneja added a comment -

            I have been trying to reproduce this error without luck. As suggested by Dan (above), Jason string is a generic error. It can happen because of few reasons. If you are still seeing this issue, then please check console and report exact error message.

            I think Vadim patch (https://github.com/vadimonus/moodle/commit/bef899b1208f943b5e1cd083f924c98fecdd730a) make sense. But unfortunately, I can't get to reproduce the original problem.

            @Philipp: Can you please try Vadim's patch and confirm if this resolves issue on opera < v12

            @Mary: Can you please confirm if this problem is still visible with 2.3

            @Andrea: Can you please put more information about this error (http://tracker.moodle.org/browse/MDL-25190?focusedCommentId=165852&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-165852). I checked secure login and couldn't replicate this issue on 2.2 (2011120504.08) and master

            Show
            Rajesh Taneja added a comment - I have been trying to reproduce this error without luck. As suggested by Dan (above), Jason string is a generic error. It can happen because of few reasons. If you are still seeing this issue, then please check console and report exact error message. I think Vadim patch ( https://github.com/vadimonus/moodle/commit/bef899b1208f943b5e1cd083f924c98fecdd730a ) make sense. But unfortunately, I can't get to reproduce the original problem. @Philipp: Can you please try Vadim's patch and confirm if this resolves issue on opera < v12 @Mary: Can you please confirm if this problem is still visible with 2.3 @Andrea: Can you please put more information about this error ( http://tracker.moodle.org/browse/MDL-25190?focusedCommentId=165852&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-165852 ). I checked secure login and couldn't replicate this issue on 2.2 (2011120504.08) and master
            Hide
            Rajesh Taneja added a comment -

            It will be helpful, if you can please provide some feedback on this issue.
            I can't replicate this issue at my end, seems this has been resolved in 2.2+

            Show
            Rajesh Taneja added a comment - It will be helpful, if you can please provide some feedback on this issue. I can't replicate this issue at my end, seems this has been resolved in 2.2+
            Hide
            Philipp Pavelka added a comment -

            Sorry for the late reply.
            I can't reproduce this problem any more.
            I've tried Opera 11.64 and an old Opera 12 beta version on the demo Moodle site which holds the version 2.2.3 (Build: 20120514). I've also installed the LastPass extension which also added its part to the JSON error as mentioned on the Opera forums but I could make the error appear.

            So the bug seems to be fixed, at least for me.

            Show
            Philipp Pavelka added a comment - Sorry for the late reply. I can't reproduce this problem any more. I've tried Opera 11.64 and an old Opera 12 beta version on the demo Moodle site which holds the version 2.2.3 (Build: 20120514). I've also installed the LastPass extension which also added its part to the JSON error as mentioned on the Opera forums but I could make the error appear. So the bug seems to be fixed, at least for me.
            Hide
            Rajesh Taneja added a comment -

            Thanks for the response Philipp,

            Closing this issue as "Not a bug", and if anyone feels otherwise then please feel free to comment. It will be helpful if you provide proper debug information, as "Invalid JSON string" is a generic message and it's very difficult to get exact cause of problem.

            Show
            Rajesh Taneja added a comment - Thanks for the response Philipp, Closing this issue as "Not a bug", and if anyone feels otherwise then please feel free to comment. It will be helpful if you provide proper debug information, as "Invalid JSON string" is a generic message and it's very difficult to get exact cause of problem.
            Hide
            Jay Knight added a comment -

            I just ran into this problem, and it matches Alan Whittamore's comment from 06/Dec/10. I made the change he suggested and it worked fine to prevent the PHP warning regarding preg_match (which in turn makes the ajax response not valid json).

            This was in FF 15, Moodle 2.2.4+ (Build: 20120823), PHP 5.3.3 (debian)

            The problem doesn't happen on our production server, where php warnings are not printed to the browser.

            Show
            Jay Knight added a comment - I just ran into this problem, and it matches Alan Whittamore's comment from 06/Dec/10 . I made the change he suggested and it worked fine to prevent the PHP warning regarding preg_match (which in turn makes the ajax response not valid json). This was in FF 15, Moodle 2.2.4+ (Build: 20120823), PHP 5.3.3 (debian) The problem doesn't happen on our production server, where php warnings are not printed to the browser.
            Hide
            Rajesh Taneja added a comment -

            Thanks Jay,

            Can you please provide me with replication steps. This will help me to pin-point the exact cause of issue.

            Show
            Rajesh Taneja added a comment - Thanks Jay, Can you please provide me with replication steps. This will help me to pin-point the exact cause of issue.
            Hide
            Andrea Gregory (Gordon) added a comment -

            @Rajesh - Moodle version is 2.2.4+ (Build: 20120712).

            These settings are set in the config file:

            $CFG->sslproxy=true;
            $CFG->loginhttps = '1';

            If I take these out uploading a profile image works fine. With them in I get the json error.

            Does this help in any way?

            I tried the preg_match change but it hasn't taken the error away.

            Thanks

            Andrea

            Show
            Andrea Gregory (Gordon) added a comment - @Rajesh - Moodle version is 2.2.4+ (Build: 20120712). These settings are set in the config file: $CFG->sslproxy=true; $CFG->loginhttps = '1'; If I take these out uploading a profile image works fine. With them in I get the json error. Does this help in any way? I tried the preg_match change but it hasn't taken the error away. Thanks Andrea
            Hide
            Michael de Raadt added a comment -

            Thanks for providing more information, Andrea.

            I'll ask Raj to have a look at this soon. It might not be for a week or so as we are heading off for the Hackfest.

            Show
            Michael de Raadt added a comment - Thanks for providing more information, Andrea. I'll ask Raj to have a look at this soon. It might not be for a week or so as we are heading off for the Hackfest.
            Hide
            Jordi Pujol-Ahulló added a comment - - edited

            Hi,

            The same patterns occurs from http://tracker.moodle.org/browse/MDL-25190?focusedCommentId=105585&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-105585 in our installation with Moodle 2.3.3 (upgraded yesterday from M2.1):

            1. When disabled loginhttps, filepickers work successfully.
            2. When enabled loginhttps, a popup with the generic JSON error message appears.

            What we could make to help?

            Edited:

            The Apache error log shows lines like these:

            • Default exception handler: Ha finalitzat l'execuci\xc3\xb3 de l'script perqu\xc3\xa8 s'ha detectat un redireccionament sense suport. Debug: \nError code: redirecterrordetected\n* line 2375 of /lib/weblib.php: moodle_exception thrown\n* line 2826 of /lib/moodlelib.php: call to redirect()\n* line 55 of /repository/repository_ajax.php: call to require_login()\n
            • Default exception handler: Aqu\xc3\xad no hi ha cap visitant Debug: \nError code: noguest\n* line 467 of /lib/setuplib.php: moodle_exception thrown\n* line 36 of /repository/draftfiles_ajax.php: call to print_error()\n

            You can try to reproduce the error following any of these points:

            1. Creating a new user from Administration. Since there is a filepicker, it finally shows the JSON error message. Or,
            2. Opening the filepicker popup with all repositories. Clicking on any respository, shows the JSON error message. And if debug messages are enabled, a message is shown in addition using javascript' alert(): "Error updating user preference 'filepicker_recentrepository' using ajax. Clicking this link will repeat the Ajax call that failed so you can see the error:" with the "Ok" button and nothing more.

            Show
            Jordi Pujol-Ahulló added a comment - - edited Hi, The same patterns occurs from http://tracker.moodle.org/browse/MDL-25190?focusedCommentId=105585&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-105585 in our installation with Moodle 2.3.3 (upgraded yesterday from M2.1): When disabled loginhttps, filepickers work successfully. When enabled loginhttps, a popup with the generic JSON error message appears. What we could make to help? Edited: The Apache error log shows lines like these: Default exception handler: Ha finalitzat l'execuci\xc3\xb3 de l'script perqu\xc3\xa8 s'ha detectat un redireccionament sense suport. Debug: \nError code: redirecterrordetected\n* line 2375 of /lib/weblib.php: moodle_exception thrown\n* line 2826 of /lib/moodlelib.php: call to redirect()\n* line 55 of /repository/repository_ajax.php: call to require_login()\n Default exception handler: Aqu\xc3\xad no hi ha cap visitant Debug: \nError code: noguest\n* line 467 of /lib/setuplib.php: moodle_exception thrown\n* line 36 of /repository/draftfiles_ajax.php: call to print_error()\n You can try to reproduce the error following any of these points: 1. Creating a new user from Administration. Since there is a filepicker, it finally shows the JSON error message. Or, 2. Opening the filepicker popup with all repositories. Clicking on any respository, shows the JSON error message. And if debug messages are enabled, a message is shown in addition using javascript' alert(): "Error updating user preference 'filepicker_recentrepository' using ajax. Clicking this link will repeat the Ajax call that failed so you can see the error:" with the "Ok" button and nothing more.
            Hide
            Luciano Silva added a comment -

            This problem keeps the same on version 2.3+. We had to apply the patchs to solve the problem.

            Show
            Luciano Silva added a comment - This problem keeps the same on version 2.3+. We had to apply the patchs to solve the problem.
            Hide
            Rajesh Taneja added a comment -

            Hello Andrea and Luciano,

            I was looking at related issue (MDL-34182) and seems this is still an issue.

            Can you please confirm few things for me:

            1. Do you have $CFG->sslproxy=true; and/or $CFG->loginhttps = '1'; in your config
            2. If above, are they defined after require_once(dirname(_FILE_) . '/lib/setup.php'); ?
            3. Does your $CFG->wwwroot has 'https://MOODLESITE' or 'http://MOODLESITE'

            I managed to reproduce this problem, and it happens only if sslproxy and loginhttps configurations are not set after setup.php is included and wwwroot is http not https.

            If above is not the case then please add more information about your setup and error msg, as with above information it's not easy to detect the cause of problem.

            Show
            Rajesh Taneja added a comment - Hello Andrea and Luciano, I was looking at related issue ( MDL-34182 ) and seems this is still an issue. Can you please confirm few things for me: Do you have $CFG->sslproxy=true; and/or $CFG->loginhttps = '1'; in your config If above, are they defined after require_once(dirname(_ FILE _) . '/lib/setup.php'); ? Does your $CFG->wwwroot has 'https://MOODLESITE' or 'http://MOODLESITE' I managed to reproduce this problem, and it happens only if sslproxy and loginhttps configurations are not set after setup.php is included and wwwroot is http not https. If above is not the case then please add more information about your setup and error msg, as with above information it's not easy to detect the cause of problem.
            Hide
            Luciano Silva added a comment -

            Rajesh,

            1.sslproxy=false and loginhttps = false
            2./lib/setup.php last lines of config.php
            3.wwwroot has http://MOODLESITE

            Luciano

            Show
            Luciano Silva added a comment - Rajesh, 1.sslproxy=false and loginhttps = false 2./lib/setup.php last lines of config.php 3.wwwroot has http://MOODLESITE Luciano
            Hide
            Rajesh Taneja added a comment -

            Thanks for the reply Luciano,

            Can you please confirm which patch your are applying to solve this problem? Is it 20110317-Fix_AJAX_WWWROOT.patch ?

            Show
            Rajesh Taneja added a comment - Thanks for the reply Luciano, Can you please confirm which patch your are applying to solve this problem? Is it 20110317-Fix_AJAX_WWWROOT.patch ?
            Hide
            Rafi Eliasaf added a comment -

            Easy way to set IIS7 File Upload Size Limits
            see http://www.webtrenches.com/post.cfm/iis7-file-upload-size-limits

            comment 1
            "Open IIS 7 SnapIn
            Select the website you want enable to accept large file uploads.
            In the main window double click 'Request filtering'
            once the window is opened you may see on top a list of tabs eg: file name extensions, rules, hidden segments and so on...
            regardless the tab you select, in the main window rightclick and select "Edit Feature Settings" and modify the "Maximum allowed content length (bytes)"

            Show
            Rafi Eliasaf added a comment - Easy way to set IIS7 File Upload Size Limits see http://www.webtrenches.com/post.cfm/iis7-file-upload-size-limits comment 1 "Open IIS 7 SnapIn Select the website you want enable to accept large file uploads. In the main window double click 'Request filtering' once the window is opened you may see on top a list of tabs eg: file name extensions, rules, hidden segments and so on... regardless the tab you select, in the main window rightclick and select "Edit Feature Settings" and modify the "Maximum allowed content length (bytes)"