Styles/Theme not loading

This forum post has been removed

Number of replies: 12
The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Styles/Theme not loading

by Marina Glancy -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hello, this looks like a slasharguments problem, take a look at this please: https://docs.moodle.org/28/en/Apache#Slasharguments

In reply to Marina Glancy

Re: Styles/Theme not loading

by Just H -
Hi Marina

Thanks but we've already looked into that when the issue first arose and it doesn't appear to be the problem. Strangest thing is if we purge all caches the sites are fine until we refresh a page in the browser.

We've also noticed that various links (edit in a course, or site admin links that toggle to show more links) no longer work when the themes are actually rendering correctly.

The problem is evident across various browsers, themes and Moodle versions so we're leaning towards some server setting that got messed up but having major problems troubleshooting exactly what setting.

Regards

H

In reply to Just H

Re: Styles/Theme not loading

by Scott Karren -

This may seem simplistic, but there have been several changes to the PHP config file between those versions.  Have you compared the old file with the new one to determine what changes you need to make (if any) to get PHP running correctly?

Scott

In reply to Deleted user

Re: Styles/Theme not loading

by ryan sanders -

<quote>

Currently there are no styles/theme rendering on both our sites (we have a 2.4 version which appears to be fine although a fresh install of another 2.4 version seems to have the same issues) 

</quote>

old version of 2.4 running fine, but fresh install does not run fine.

i might suggest download files from "2.4 running fine" to desktop computer. and then do same for the other version.

<>and then use "win merge"  to do a file comparison see if someone did a core editing of some files. 

=================

database -> config (table) and config_plugins (table) holds pretty much all settings.. you might do a backup of those tables to a file. and then do a winmerge of the backups.

=================

you might try to run "shifter"  not sure when it came in to play.  and needing to run it. to deal with javascript and YUI.  ((double check docs.moodle.org  and/or docs.moodle.org/dev  ((there 2 complete different wiki's)) 

=================

site admin menu -> security

site admin menu -> developer

check all the sub links in above 2 areas.  there is a good amount of "checks" that can be ran.  

==================

keep in mind, to clear all browsers history / cache,  besides moodle and purging all cache there.  

In reply to ryan sanders

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Styles/Theme not loading

by Alvaro Parra -

Hello, first, sorry for my english.

Moodle version: 2.6.3. 

I had same problem. I didtn find solution. Ever same: menus collapse, any theme, any moodle version. 

My problem was cache YUI files and javascript-static was corrupted, Unexpected token illegal is shown. And YUI is not defined too (normal, with this corrupted chars)

In my case, sometimes, changing settings, error is resolved until page is recharged.  I think is cache problem. 


But i can resolve it partially. First all, i observed that corrupted files, sometimes, was right. Then i download this files, yui libraries and javascript-static.js, later upload to my server, and get urls from theirs.

I get file outputrequirementslib.php from {MOODLE-PATH/lib}, find get_head_code method and go to:

$output .= $this->get_yui3lib_headcode($page);

and 

 $output .= html_writer::script('', $this->js_fix_url('/lib/javascript-static.js'));

I comment it, and i add my custom yui and javascript-static links. This:


$output .= '<link rel="stylesheet" type="text/css" href="PATH/cssreset-min.css" >' . "\n";

$output .= '<link rel="stylesheet" type="text/css" href="PATH/cssfonts-min.css" >' . "\n";

$output .= '<link rel="stylesheet" type="text/css" href="PATH/cssgrids-min.css" >' . "\n";

$output .= '<link rel="stylesheet" type="text/css" href="PATH/cssbase-min.css" >' . "\n";

$output .= '<link rel="stylesheet" type="text/css" href="PATH/yui-moodlesimple-min.css" >' . "\n";

$output .= '<script src="PATH/yui-moodlesimple-min.js"></script>' . "\n";

$output .= '<script src="PATH/mcore-min.js"></script>' . "\n";

$output .= '<script src="PATH/javascript-static.js"> </script>' . "\n";


I remove yui auto load, and set my yui files previously downloaded and uploaded to my server.

This resolve it partially, yui errors is not shown and menus is working right. 

I think is bad solution, but now teachers can use the platform. 


Please, if someone can help with this problem, the illegal characters in cache files (yui and javascript-static.js mainly, but others too).  I dont know why. 

Thanks to everyone. 

Bye.

In reply to Alvaro Parra

Re: Styles/Theme not loading

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

It really sounds as if you need to reinstall Moodle.

That sounds like a significant file corruption problem rather than a theme issue

In reply to Richard Oelmann

Re: Styles/Theme not loading

by Alvaro Parra -

I reinstalled several moodle versions, and problem persist. Include last moodle version. My problem is that my moodle is migrated from other server, i think is server configuration, but i dont know what.

In reply to Alvaro Parra

Re: Styles/Theme not loading

by Ken Task -
Picture of Particularly helpful Moodlers

Might be way off base here, but ...

There's lots of caching going on:

Check out: /moodledata/cache/cachestore_file/default_application/core_yuimodules

one could remove manually and that should rebuild.

With multiple Moodles on same server using the same PHP, what of zend_opcache?   Have a script that checks what opache has cached?

Can acquire one:

https://rtcamp.com/tutorials/php/zend-opcache/

and install on server to see as well as refresh.

'spirit of sharing', Ken


In reply to Ken Task

Re: Styles/Theme not loading

by Vasanthakumar Sithuraj -

Hi,

*Problem resolved, Solution at the end the message*

I had faced the same issue with the latest stable release as of now which is 2.9.2+

I have tried all the possible solutions mentioned in this thread as well as on Google / Stackoverflow.com; none of it fixed this problem and site was crashing every time I refresh cache using Ctl+F5 (with the exact same errors mentioned in this post).

I had to figure out myself that the "pagespeed" module was conflicting with something (which I don't know). I tried disabling pagespeed filters one by one, and the issue persisted even after disabling all the filters.

Finally I had to completely disable pagespeed module in my Apache by commenting out the following lines on my httpd.conf (and of course I need to restart my Apache server once after this change). Once done this my problem completely disappeared; but I could see my site is slightly slow, but it's much better than the completely broken one.


Disable pagespeed module as shown below by commenting the two lines in httpd.conf and restart Apache.

#Include conf/pagespeed.conf
#Include conf/pagespeed_libraries.conf


regards,
Vasanth


Average of ratings: Useful (2)
In reply to Vasanthakumar Sithuraj

Re: Styles/Theme not loading

by Ken Task -
Picture of Particularly helpful Moodlers

First, thanks for posting back solution to the issue.  More should do that.

Yep, very wise to turn off pagespeed (a google add-on for Apache servers which is now part of the GoogleGrave Yard.  There are now articles written each year on the topic.).    That's one minus for using Google API's and offerings ... what Google giveth, Google can Taketh away!    They do provide advanced warnings to give users of Google services (paid or free) time to find an alternative and adjust, but unless users stay on distribution list/watch list or something, many get 'blind sided'.  All that to say, I too, had been 'blind sided' by pagespeed  one Apache server (just glad I hadn't really decided it was  good enough to use and configured all the servers I support with it!).

Have started to pay more attention to Google 'things' in that light ... especially those that are plugins to Moodle.  Am of the opinion now, that even though there is a plugin, one might be wiser to see how else to integrate - example: don't use Google OAuth 2 authentication but your own LDAP, but provide custom menus to go to the entities Google Domain Drive/Docs/Sheets, etc..   Using FireFox/IE/Safari in a typical fashion would mean another login/password routine, but with Chrome and Chromebooks ... not so!

Also a reason for Moodle users to think about any add-ons/plugins.  Like many, I too, loaded up my 1st Moodle where I had learned to install add-ons and plugins and themes, only to be in a 'pickle' the first upgrade. :\  (Lesson learned though!)

Always something to think about, isn't there? ;)

'spriit of sharing', Ken

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

Re: Styles/Theme not loading

by John McDonald -
I'm using 2.6 as my production server. I'm working on upgrading to 3.X. I have literally everything working except the initial load of the site, the styles inconsistently show/don't show. Upon a page refresh, the styles display correctly. I have tried the slasharguments, pagespeed, etc. to still have the occassional issue. I've deleted the cache in the moodledata folder, I've deleted the root config.php and recreated it from install, and still have the issue. 


My 2.6 server is running win server 2008, IIS 7, PHP 5.5.9, MySQL 5.1.72. 

My 3.X servers are running Win server 2008, IIS 7, PHP 7.0.5, MySQL 5.7.12.

PHP is configured the same on both. The only difference with MySQL is the table type being barracuda vs antelope.


Any ideas are welcome! Thanks!