When changing the theme it is necessary to rebuild the CSS

When changing the theme it is necessary to rebuild the CSS

by Marcos Borba -
Number of replies: 4

Hello,


We currently have an environment where with each change in the Adaptable theme, the page takes a long time to load and is disfigured. It is necessary to run the "Build theme CSS cache" script for it to work normally.


"php admin / cli / build_theme_css.php --themes = adaptable"


The Boost theme worked perfectly before Adaptable.


Environmental information:

Moodle 3.8.4+ (Build: 20200723)

Adaptable 2.2.2 - 2019112603


PHP7.3-fpm - PHP 7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6

MPM Event

Apache / 2.4.25 (Debian)

Mysql 5.6.40


Thanks,
Marcos Borba

Average of ratings: -
In reply to Marcos Borba

Re: When changing the theme it is necessary to rebuild the CSS

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Marcos,

Umm, ok... so not sure why you're doing that manually? But since that version of Adaptable, I've gone through every single setting and now the theme only rebuilds the theme cache when it actually has to, i.e. the setting changes something that causes a change to the CSS. Unlike before when the theme cache reset code was added without thinking.

You also state that the Boost theme worked perfectly before Adaptable... but Adaptable is a far more complex theme than Boost, so logically will take longer.  Also note that its not only the theme CSS that's recreated but all the rest.  So by only having the plugins installed that you actually need will mean that the cache rebuild will be as fast as it can be and as small as it can be too.

G
In reply to Gareth J Barnard

Re: When changing the theme it is necessary to rebuild the CSS

by Marcos Borba -

Hi Gareth,

I agree with you, it is quite intriguing because this is happening.

We have another environment with exactly the same configurations, the same plugins, the same versions ... as if it were a mirror. And this problem does not happen.

I compared the Moodle folder of both environments and they are the same.

I checked the permissions, no errors are generated in the Apache or PHP log ... but I can't find the error.

Activating the browser inspector, error 500 is displayed for the file "all", apparently it takes a long time to load and fails. the PHP parameters have already been changed to increase this time, but the same error is displayed.

Updating ... I changed the theme to Boost and it's working perfectly without having to rebuild the CSS.

Unfortunately Adaptable remains with the problem.

Once the settings are finalized, we will have no problems. The site will work normally. However, it is not normal behavior to need to reconstruct the theme.

What information would you need to try to debug this error or what recommendations would you give to resolve this issue?

Thanks,
Marcos Borba

In reply to Marcos Borba

Re: When changing the theme it is necessary to rebuild the CSS

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Ok, as the issue happens on one server and not another then it's probably not a theme issue. If you're getting a 500 error, then look in the PHP error log to see if there are any errors - Apache's 500 is due to the failure of PHP doing the task Apache set it - so turn on 'developer level debugging' as you say there is nothing in the log, but that's often what causes 500 errors - i.e. PHP falling over. As you're not running the 'current' version of Adaptable for Moodle 3.8 - being 3.8.1.1 -> https://moodle.org/plugins/pluginversion.php?id=23659 - then I won't even entertain investigating the issue. And it would have to be that all identical sites have the issue to convince me to spend time on the belief that it could be a theme thing.
In reply to Gareth J Barnard

Re: When changing the theme it is necessary to rebuild the CSS

by Marcos Borba -

Hi Gareth,

Thank you for the informations! Although other themes work without problems, we found that, for a reason still unknown, we managed to make Adaptable work after changing the website's configuration file in Apache.
We changed from MPM Event to MPM Prefork and enabled the Rewrite module.
That done, everything went back to normal.