Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After using the module I noticed a problem with the css files.
More specific, I set the module to auto logout the users after 120 seconds. I login with a user account to my site and afterwards I close the window. When I open a new window after 130 seconds and visit the site, the user is auto logout (as he is supposed to be) but the page opens with no css files. If I refresh the page it reloads my site normally (with the css files of my theme).
Comment | File | Size | Author |
---|---|---|---|
#5 | autologout-preserve-css-2297515-5.patch | 705 bytes | amoebanath |
#2 | after_the_refresh.gif | 59.8 KB | chrbak |
#2 | before_the_refresh.gif | 59.2 KB | chrbak |
Comments
Comment #1
johnennew CreditAttribution: johnennew commentedCan you do any further analysis of what is going on? This isn't something I am able to replicate so might be something with your setup. After the page loads with no CSS can you view source and see what CSS links are included? Are they correct? Can you switch your theme to a Drupal default one and see if it works with a core theme?
Comment #2
chrbak CreditAttribution: chrbak commentedHello @ceng, I install the module in another site and it did worked fine, so the problem relies on the setup of the specific site I first used.
I checked the paths of the css files and are correct but I noticed that there are missing 3 css files. I have attached two source code snapshots of the page before and after the refresh. As you can see the style1.css, responsive.css and style.css are missing.
I use a subtheme and modules like Front Page..
Comment #3
kholloway CreditAttribution: kholloway commentedFYI. I am experiencing the same issue with my custom theme CSS files not loading after the initial page load after an auto-logout occurs.
if it helps to provide more information the parts that are being skipped is:
I'm not sure if it's skipping my entire css.inc file or just these but those never come through the first time. Will continue looking into what could be causing this behavior.
Comment #4
kholloway CreditAttribution: kholloway commentedI resolved the issue by making the following theme fix:
I noticed the theme css include file (which contained the code posted previously) was just inline (included) php in the template.php theme file. I moved the code to inside a THEME_preprocess_html function and this problem went away.
If you are having this problem you might want to double check where your CSS is being loaded and make sure it's correct :)
Comment #5
amoebanath CreditAttribution: amoebanath commentedWe've had this issue also. Steps to reproduce:
The results is that any calls to
drupal_add_css
which were made beforeautologout_init()
ran are clobbered by this code:(Specifically, the call to
drupal_static_reset()
)As such, this patch ensures that autologout_init() runs before any other hook_init() hook implementations (any of which may call drupal_add_css()).
In the Drupal 6 version of this module, the weight was set to 1000 (which was never reset by the Drupal 7 version in its place), which means autologout_init() runs quite late if you've upgraded. So, this issue was quite noticeable for us. It will be less noticeable for fresh installs, because the module weight will be set to 0, and the module begins with an 'a'. There is a good chance that in this case no hook_init() implementations that run before autologout_init() call drupal_add_css(), so may not be noticeable.
Comment #7
MrHaroldA CreditAttribution: MrHaroldA commentedThe proposed solution does not fix our issue with CSS-less pages after autologout. When returning to the site after the logout period has passes, you'll end up with an unstyled page stating thaty you've been logged out due to inactivity.
This is with JS enabled, and yes; I cleared the cache ;)
At fritst I thought that it was due to the Varnish caching layer, but after disabling that it still occurs, even with the patch from #5.
Comment #8
JordanMagnuson CreditAttribution: JordanMagnuson commentedYep, just discovered this same issue on my site after upgrading to the 7.x-4.x version of this module.
Here's a sample page (missing proper css) after coming back from being auto logged out: http://i.imgur.com/8O8oKPM.png
Here's what the page looks like after a refresh: http://i.imgur.com/i6k77EF.png
Comment #9
johnennew CreditAttribution: johnennew at Deeson commented@JordanMagnuson did you see if the solution provided by the patch in #5 fixes this for you? Do you know if you have any drupal_add_css calls in your hook_init functions?
Comment #10
JordanMagnuson CreditAttribution: JordanMagnuson commentedI'm trying the patch now.
Comment #11
JordanMagnuson CreditAttribution: JordanMagnuson commentedThe patch in #5 is working for me.
Comment #12
DeaOm CreditAttribution: DeaOm at Agiledrop - Your Trusted Drupal Teammates commentedIs this issue still present? I can't seem to reproduce it. And if is, does the patch #5 still solve it?