General developer forum

 
 
Picture of Oren Bochman
Problem with javascript-static.js
 

Hi I'm a moodle newbie.

I have just finished installing moodle 2.3.6+ on lamp.

While cheking the site as admin I noticed the UI is broken.

after a consult at #moodle on IRC I noticed that the issue is due to 

/moodle/lib/javascript.php/1366301765/lib/javascript-static.js which was not found.

I checked the moodle installation and the file is available at 

/moodle/lib/javascript-static.js

any idea how to fix this?

 
Average of ratings: -
Picture of Hittesh Ahuja
Re: Problem with javascript-static.js
 

permissions issue on the file maybe ? i'd like to give it a 755 .

 
Average of ratings: -
Picture of Oren Bochman
Re: Problem with javascript-static.js
 

I also think this must be some rights issue 

I tried that too but it seems to make no difference.

any idea why the a static file get's its paths munged up like that 

 
Average of ratings: -
Picture of Hittesh Ahuja
Re: Problem with javascript-static.js
 

are you using chrome ? what is the file status under resources ?what http error do you get ? (404 / Permissions error?)

 
Average of ratings: -
Picture of Andrew Nicols
Re: Problem with javascript-static.js
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Try clearing your cache. The path is changed for this static file to improve cacheability. javascript.php ensures that various headers are set to try and ensure that the browser caches the file, and is designed such that subsequent calls for the same file where the browser provides a Last-Modified header just result in a 304 not changed. javascript.php also minifies the files on the fly. The timestamp is to ensure that when you upgrade Moodle, the timestamp is reset, thus changing the URL, and a browser will re-request a different file.

If you clear your cache, this will remove the existing server cache of the minified file, reset the timestamp in the URL, and this should mean that you get the file served. Most likely, something has caused the cache to be incorrect somehow - this may happen if your storage is flaky for example, or something odd happened the first time the file was requested and a dodgy copy was stored. This shouldn't happen, so if know the cause, it may be worth raising an issue so that we can prevent similar things happening again.

Andrew

 
Average of ratings: -
Picture of Oren Bochman
Re: Problem with javascript-static.js
 

Thanks for the support

  • I was getting a 404 error.
  • Clearing the cache did not help.

I was not able to fix this even after reintsalling and upgrading - so I eneded up scrapping the virtual machine and reinstalling lamp+moodle.

Now I no longer have this problem.

 
Average of ratings: -