Moodle file picker not working

Re: Moodle file picker not working

by Emma Richardson -
Number of replies: 27
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Try clearing your caches...

In reply to Emma Richardson

Re: Moodle file picker not working

by Rob Clark -

Hi,

I'm experiencing the same problem.  File picker in the forums are not loading correctly into the page, but it is not consistent.  The problem does not happen on some browsers, but is happening on other browsers and operating systems.  It is also not consistent across the entire Moodle site.  The file picker loads properly in assignment submission, but not on forum postings.

I'm running Moodle 2.7.

  • Firefox 53.0 for Mac - loads properly
  • Safari 10.0.2 for Mac - does not load the picker
  • Chrome 57.0.298 for Mac - does not load the picker
  • Firefox 52.0.2 for Windows - loads properly
  • Firefox 53 for Windows - does not load the picker
  • Chrome 58.0.3 for Windows - does not load the picker
  • Internet Explorer 10 for Windows - does not load the picker
  • Microsoft Edge for Windows - does not load the picker

I have tried clearing cache, doing a hard refresh, using different browsers and operating systems, etc. to identify the source of the problem, but to no avail.  I have several hundred students in courses right now who are not able to submit files because of this problem.

Any help anyone can provide would be greatly appreciated.

Thanks.

In reply to Rob Clark

Re: Moodle file picker not working

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Try turning off the Javascript caching found under Appearance/Javascript and Ajax - I had to do that on one of my sites.

In reply to Emma Richardson

Re: Moodle file picker not working

by Rob Clark -

Hi Emma,

Thanks for your prompt response.  I just tried your suggestion with hard resets and cleared caches all around, but it didn't work.  Anything else come to mind?

It only just started happening yesterday, and one of my staff just had her browser update when she re-opened it and the problem started for her with the new update.  The only thing that I can see as a common major update across all browsers is that they have all stopped supporting Java NPAPI with the latest release.  Do you know if the Moodle File Picker is run as NPAPI?  I can't find anything in the documentation.

Cheers,

Rob





In reply to Rob Clark

Re: Moodle file picker not working

by Rob Clark -

Is it because the File Picker in Moodle 2.7 runs as NPAPI, which is no longer supported by browsers?

R

In reply to Rob Clark

Re: Moodle file picker not working

by Rob Clark -

Found the problem.  The mathjax shutdown on April 30th was the source.  I simply loaded mathjax on my local server and redirected it in Site Administration > Plugins > Filters > MathJax from cdn.mathjax.org to mymoodleserver.com. 

Problem solved.  Thanks a lot for your help, Emma.

Rob

In reply to Rob Clark

Re: Moodle file picker not working

by Ron Vitug -

We have same issue file picker is just keep spinning/loading. Then it will hang the moodle site I need to restart apache to able to access again. Moodle 3.1.6 is our versionscreenshot


Attachment moodle file picker.JPG
In reply to Ron Vitug

Re: Moodle file picker not working

by Ken Task -
Picture of Particularly helpful Moodlers

Did you recently upgrade from 3.0.highest to 3.1.highest?

Actually, that might not matter but would help me verify what I found doing an upgrade as above.

Beginning version 2.9.x Moodle 'transitioning' away from the YUI library.  YUI library might be used in filepicker.

https://docs.moodle.org/dev/YUI

Is your site set to combo load YUI libraries?

Try this in config.php of site:

$CFG->useexternalyui='0';
$CFG->yuicomboloading='0';

Check your DB - mdl_config table to see any settings for YUI external or combo loading.

Purge server caches ... might have to do that manually to assure
caches have been eradicated.

IF the above works, suggest making sure that YUI settings stay '0'
by editing the mdl_config table and setting the above variables to '0'.

You could then remove the config lines.

'spirit of sharing', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Moodle file picker not working

by Ron Vitug -

Tried and still no luck. I am thinking if it's a repository matter since we upgrade it to the new server?


We're running PHP on Apache with mod_php 

In reply to Ron Vitug

Re: Moodle file picker not working

by Ken Task -
Picture of Particularly helpful Moodlers

Describe 'upgrade it to the new server', please.

What makes one think it's a repository matter?

"Faculty Documents" looks to be a file system repo.

So in moodledata/repository/ ... what does 'Faculty Documents' label actually point to?

And does what it points to has correct ownership/permissions?

If version 3.3 you have a new CLI script in moodlecode/admin/cli/

Run from moodlecode/admin/cli/

what does the following show?

php cfg.php |grep repository

and

php cfg.php |grep yui

'spirit of sharing', Ken


In reply to Ken Task

Re: Moodle file picker not working

by John Joubert -

Ken,


I'm running moodle 3.1.3 - and YUI combo loading is turned off. However, it's default is to be on.   I'm dealing with performance issues since my recent upgrade from moodle 2.7 to 3.1.3.  Is this safe/good to turn on?  Or, should I be avoiding this since, like you, I've read that it's going to be depracated at some point...


Any advice, direction, pointers, etc. appreciated very much.


John

In reply to John Joubert

Re: Moodle file picker not working

by Ken Task -
Picture of Particularly helpful Moodlers

Not sure that YUI alone would be the single factor in a hyperjump between long term support versions 2.7.x to 3.1.x in performance issues.   Like all previous versions of Moodle every version upwards does more ... and seems to require more resources of server.

Did you do the environment check and update that component before upgrading?  Did you have to 'fix' anything while at 2.7?  Run it again, now at 3.1.x and see if there are not some recommendations.

As far as performance issues ... think you'll have to share a complete description of your system(s).

'spirit of sharing', Ken




In reply to Ken Task

Re: Moodle file picker not working

by Matt Donnelly -

Thanks Ken! 

File Picker was consistently hanging only in Chrome for 30sec (checked Network Tab in Inspector) on Moodle 3.5 before allowing me to select files.

Adding those two lines to config.php fixed the problem immediately. 

In reply to Matt Donnelly

Re: Moodle file picker not working

by John Byrne -

What were the lines?  It sounds like that was the problem.

I'm having the same issue.  Please help.

Thank you,

John Byrne

In reply to John Byrne

Ri: Re: Moodle file picker not working

by MARCO BONFIENI -
Hello there,
if I can share my experience, took a lot of time also for me to figure it out!
I also know it has been 6 months since that post: the problem was in my case the SSL certbot from Let's Encrypt

You can find the solution also in another locked post, it really did the trick!

Fin your ssl.conf file, usually located under /etc/httpd/conf.d

Find the line
Header always set X-Frame-Options

Should be set "DENY" by default... replace "DENY" with "SAMEORIGIN", then restart your httpd service.

Boom!
In reply to MARCO BONFIENI

Re: Ri: Re: Moodle file picker not working

by Landy DeField -

This worked for me! 

Hey documentation @Moderator this really should be added to https://docs.moodle.org/311/en/Transitioning_to_HTTPS page.

In reply to Landy DeField

Re: Ri: Re: Moodle file picker not working

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Landy,

Thankfully that page is a wiki and can be amended using your moodle.org login credentials. You would be in a good plac eto update this documentation as you have experienced this issue and understand the changes.

I'm not quite sure why this is ncessary - I don't believe that it should be for normal usage, and this is very much a configuration issue - it will depend on your Apache installation and configuration and you should understand such changes before making them.
In reply to Andrew Lyons

Re: Ri: Re: Moodle file picker not working

by Landy DeField -

I did not see the edit link for that page, I will look harder. ;)

Reasons it should be included on the page.

  1. It is 100% related to transitioning from HTTP - HTTPS.
  2. If you transition from HTTP - HTTPS and do not edit the Apache config file, the popup ajaxified file dialog window just sits and spins... smile
  3. It is not easy to diagnose as no error generated in apache2 error log.
  4. Save people making the move to HTTPS on Apache some time and stress. :D 
In reply to Landy DeField

Re: Ri: Re: Moodle file picker not working

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
It is 100% related to Apache configuration. You are including a default configuration for SSL from your linux distribution which includes the DENY line. Not all stock configurations will include this line, or with this default setting.

Your previous configuration did not include this line, but it could easily have done so - it is an http response header and can exist on both HTTP and HTTPS connections.

You should ensure that you understand the purpose of this lin before making these changes.
In reply to Andrew Lyons

Re: Ri: Re: Moodle file picker not working

by Landy DeField -
Not really seeing where your coming from as https://docs.moodle.org/311/en/Transitioning_to_HTTPS has 100% Apache configurations listed, the edits should be done to the .htaccess file which is distribution agnostic, and the link I included goes into depth about the purpose of the Header always set X-Frame-Options as well as WAMP configurations.
When all is said and done, I took the time to submit an edit, as you pointed out I could. Either it's accepted or not, either way I did due diligence.
Peace Out! :D
In reply to Andrew Lyons

Re: Ri: Re: Moodle file picker not working

by Landy DeField -
I submitted the following edit to the end of the page.

"
=== File upload dialog configuration for Apache2 ===
If you are using Apache2 on a Linux server after transitioning to HTTPS, the file upload dialog may not work properly and hang after clicking the upload button. In order to correct this, you will need to edit the /moodle/.htaccess file.
You will need to add the following:

Header always set X-Frame-Options SAMEORIGIN


Save the file then reload/restart the Apache2 server.

* [https://apache.tutorials24x7.com/blog/how-to-secure-apache-from-clickjack-attack-using-x-frame-options Tutorial Explaining X-FRAME Options With LAMP & WAMP How To]
"
It is now in the hands of the wiki gods ;)
In reply to Ron Vitug

Re: Moodle file picker not working

by Rodrigo Ribeiro -

Hello


Having the same inssue! My server is a DigitalOcean VPS ans everything is ok with VPS.

Centos7++Apache2+PHP7 (no fpm)+Moodle 3.4+


Alredy tried to set yui to "0" in mdl_config....not solved.


When send any file the circle still running forever...


What i have to do?



In reply to Rob Clark

Re: Moodle file picker not working

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

Hi Ron,

Are you running PHP on Apache with mod_php or with php-fpm? I had a similar problem switching from Apache to Nginx.

Daniel

In reply to Daniel Thies

Re: Moodle file picker not working

by Francisco Nieto -

Did you find a solution to your issue? I have moved to ngixn and php7.0-fpm, and I am experiencing the same issue. When I try to upload a file with the file picker, it keeps spinning and it seems like it never upload the file; however, when I drag and drop the file, I do not have any issue.

In reply to Francisco Nieto

Re: Moodle file picker not working

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers
Yes, there is a setting that needed to be changed in the http block of my nginx.conf. The parameter client_max_body_size has a default value of 1M. This limits any file upload to the server even though php settings are higher. It is not detectable by the browser so nothing is reported.
In reply to Daniel Thies

Re: Moodle file picker not working

by Francisco Nieto -

Thanks so much for answering me back, but my issue was not the parameter client_max_body_size, it was the parameter below, I had the parameter set up as "DENY" instead of "SAMEORIGIN"


add_header X-Frame-Options SAMEORIGIN;


Thanks again for you prompt answer.

Francisco

Average of ratings: Useful (1)
In reply to Francisco Nieto

Re: Moodle file picker not working

by Harry McLaren -

Just an FYI for others, our site had this issue and after MUCH troubleshooting, it was the Cloudflare 'Rocket Loader' which was breaking it. 

Average of ratings: Useful (2)
In reply to Harry McLaren

Re: Moodle file picker not working

by David Le Blanc -
Thank you for this post Harry. How did you resolve the issue with Cloudflare 'Rocket Loader'? I have started to experience difficulties with the File picker and even uploading images with the dialog box that appears after clicking the images button in our atto editor.