civicrm / org.civicrm.shoreditch

Other
44 stars 59 forks source link

Theme gets lost every day or at drupal's session end #520

Closed niels-heinemann closed 3 years ago

niels-heinemann commented 3 years ago

Hi all,

I followed the steps to install required drupal modules and latest shoreditch version on latest drupal 7 and latest civicrm.

After that I can see shoreditch as an option in Backend Theme and Frontend Theme setting in /civicrm/admin/setting/preferences/display?reset=1. But I cannot see the extension in civicrm extension screen /civicrm/admin/extensions?reset=1.

cv en enables the theme.

Every day or at every drupal session end the theme gets completely lost. It's not applied anymore and it's gone in the civicrm display preferences.

Any ideas?

niels-heinemann commented 3 years ago

Please dear folks, help me. The theme gets lost every x hours and magically comes back after some more hours.

MegaphoneJon commented 3 years ago

I haven't seen such a thing, and I run a lot of Civi instances. If I had to guess, I'd say you have a permission problem caused by your cron user not being the same user that your web-facing PHP uses.

Things you can test:

niels-heinemann commented 3 years ago

Dear Jon, thanks a load for your ideas! I'll give a try and see.

niels-heinemann commented 3 years ago

PHP is run by apache's user in cron, cv flush reactivates the theme. I'll check console and network errors in my browser on next fail.

MegaphoneJon commented 3 years ago

You say PHP is run by Apache's user - are you using mod_php? If you're not - say, you're using php-fpm - then the PHP user for web requests may be different from the Apache user.

niels-heinemann commented 3 years ago

Yes, I'm afraid it's mod_php :/

niels-heinemann commented 3 years ago

No network nor console errors in FF when theme is autodisabled :(

MegaphoneJon commented 3 years ago

I suggest right-clicking one of the HTTP requests in the Network tab and selecting "Save all as HAR". Then do the same when the theme is working. Check if the same files are being loaded each time.

Another idea - make sure CSS aggregation is disabled, and then use "Inspect Element" on the same element both when it's working and broken. The "Rules" section will show which rules are being applied, and which files they're coming from.

My thinking is that either a) there's one or more rules that are present (or absent) when the theme is working compared to when it's not; b) there's some subtle difference (perhaps in the ID of a parent element) that's causing the theme not to be applied.

niels-heinemann commented 3 years ago

Quite great ideas, thanks, I'll try!

niels-heinemann commented 3 years ago

This is really tricky, but as far as I can see, all references to bootstrap are missing in the html source when the theme is missing.

niels-heinemann commented 3 years ago

Jesses, I found the problem. It turned out to be a function call in a civicrm extension which was located directly in the file and outside any function. Seems to have been working for years but now has led to obscure misbehaviour in different modules...