Hi

I got a really frustating problem and although I've searched countless hours to solve this problem (hours that i was supposed to enjoy theme development) I can't find a proper solution.

The problem is that although I am making changes in graphics and css drupal keeps showing the old stuff.

For example i made some graphics wider, upload em, changed the css and now I can see the css having new values, it keeps showing me the old graphics. Anyway I solved that problem (not a solution really but anyway) by renaming the graphics. So now I have about 25 versions of top_banner.png and around 40 i think of footer graphic.

After that I tried to make some changes to css only. Like different bg color in some elements, or different font sizes and stuff like that. Simple things. Simple things that anyone would think it work right on hitting the refresh button.

But guess what........ Yeap. U got it right. Drupal with all its wisdom keeps showing me the old css.

So far I tried without success:
- Multiple browsers on multiple machines
- Renaming or deleting the css file which resulted in a page with no style which is a progress but when i returned the file back to normal nothing changed.
- Change the default theme to every possible theme I could found and back to mine
- I am pretty sure that all the cache stuff is on disabled in performance
- Press clear cache in the same page
- Hit multiple times with speed and power variation the f5 and ctrl+f5 button on browser
- Hit my monitor enought time to start showing some weird colors

And also I tried one more thing that it really worked

I've used another platform on the same server just in case it was a server problem and it worked perfectly.
css change -> f5 -> New things in browser -> Happy designer

Although I was really happy that I am not so stupid that I can;t make a simple css change in drupal and I had my site up and running in the new platform this is not a solution.

So anyone who had the same css nightmare with me and found a solution? Tip? Thread that I missed while searching?

Thanx in advance.

Comments

pbarnett’s picture

Clear your caches and the theme registry, and make sure you don't have CSS aggregation enabled.

Raytracer’s picture

As I said I have everything about cache disabled and I don't have CSS aggregation on.

About the theme registry I do not know for what r u talking about but I'll look for it.

Thanx for your time.

bwv’s picture

Are you using the color module? If so, there is a cache you need to clear before you will see your changes.

Jeff Burnz’s picture

If using color module with themes like Garland, Pixture Reloaded etc then you have to go the theme settings and save the settings each time you change the CSS. This is just the way it works because the style.css file is parsed and re-written by the color module and cached on the server in the files/color folder - which is the file the theme uses. I can't think of another reason why this would happen other than you are using a theme with the color module.

A way around it might be to call another css file from the info file or drupal_add_css in template.php and place all custom styles there.

Raytracer’s picture

Thanx for your answers but even the admin module didn't work after pressing the flush cache button multiple times.

No I am not using color module and the theme was build from scratch.

Now I am having problem with swf files too.
Although I've renamed the swf and upload the new one on server it keeps showing me the old one.
After 10-20 tries of hitting clear everything in my browsers, hitting flush cache in admin module and refreshs I gave up and tried the same trick with the images. Rename and change the link for the swf. This ofc worked but as all my other folders now I got flash_001, flash_002, flash_003 etc.. I believe 3 number digits will be ok for the rest of the year as this is a flash banner that will be change frequently but I am not sure If the server space will be enough

Anyway. The last problem I encounter was that I was needing this particular flash to have an extra div as container and some styles. Ofc this didn't work either (the suprise would be to work as it should) and although I can see the changes in source view in ckeditor when I am checking the source code from browser its like the changes never happened.

I think its ghosts or goblins but I found a solution. Yeaaaaaaa. Guess what I did :)

I created a new page with the same content. Ha. Now I am prepared and I've started to organise my pages with 000 prefix to be sure.

So to sum it up, in drupal:
1) If u want to make changes to a page don't bother. Drupal is attached to this page and loves it as it is. Create a new one instead
2) if u want to change css, images etc. Pls do not try it alone. Its hazardous. Prepare your filenames with lot of digits like 00000000_style.css or something so that u can have a chance to c a difference. If u don't like this solution u can upload a new theme everytime u change the color for the fonts or a background color.
3) Prepare yourself to clear cache zillion times just in case something will work

So cheer up and happy theme developing lol

Jeff Burnz’s picture

Wow, your problems are so unbelievable they're almost unbelievable...

Raytracer’s picture

Wow u post something just to post something. Your help is unbelievable......

Jeff Burnz’s picture

Well, here's the thing dude:

CSS files are a file system thing, but nodes are stored in the database. So, in a bizarre coincidence both the node_revisions table is not updating and mysteriously writes to the server file system are silently not happening.

One would think you'd get a database error, such as "Got error 28 from storage engine".

With the CSS it could be a permissions or ownership issue, for example if you created these files via some sort of control panel then maybe Apache owns them, and when you try to update via ftp they are simply not overwritten, but rather the operation is silently dropped (perhaps your server or your FTP client fails to communicate this with in a way that its obvious).

Look, if you are doing everything right at the Drupal end of things, then clicking clear caches a dozen times is not going suddenly yield a different result. The issues lies elsewhere. Its not exactly good advice to tell other people to follow your hackish work-arounds when the right thing is to actually diagnose and fix the real problem. This can take time, a lot fo time, especially if you are new to everything, there's many things to learn and often they are complicated and extremely difficult to diagnose via a forum thread.

Raytracer’s picture

Well m8 that was a good answer and thanx for the time u took to reply.

First of all I am most a designer so its kind hard to check all these stuff or even think that might be such issues.

So u r saying that this might not be a drupal as a platform problem but an installation problem in generall. I'll find someone who knows better than me to check it then.

Finally I never said to someone to follow my "hackish" work around.
I was simply saying what my problem was as descriptive I could and what I did in order to "fix" it.

I was asking for advice and still am with a bit of humour and also posting some of the solutions I found as a designer to my problems just in case someone might say "no this is stupid. do not duplicate that" or "I am sorry but the only way to change css is to make a new style" or something.

Anyway, I really appreciate your help and the time it took u to answer me. I'll try to contact an expert to check all these.

Thanx

kruser’s picture

I'm currently having the same issue all of a sudden. Drupal will not show an updated css file. Even if I delete it from the server, it still shows the file!!!!!

I disabled all caches, restarted apache, disabled APC. There should be no reason for it showing the same old file.

-----------------------------------------------------
Bob @ Drupal Aid (https://www.drupalaid.com)

bwv’s picture

Have you cleared your cache? (You said above you had disabled it.)

kruser’s picture

yes, I cleared it a lot of times.

-----------------------------------------------------
Bob @ Drupal Aid (https://www.drupalaid.com)

bwv’s picture

And turned off CSS aggregation (under performance)?

kruser’s picture

Yes, No aggregation. When I pull up the url for the css file itself and continuously hit refresh, even when the file is physically not on the server, it still displays.

I've double check all my paths and directories, this issue make absolutely no sense to me.

I recently renamed the css file, updated the .info, and the new file pulled up okay and so far has been updating okay as I make changes.

-----------------------------------------------------
Bob @ Drupal Aid (https://www.drupalaid.com)

Jeff Burnz’s picture

If the file is not on the server but is still showing in the browser, then you have ask yourself, where is this file physically located, because it is on a server, somewhere.

Providing the URL to the file and your site would certainly help, trying to guess the issues is pretty impossible.

zakir.gori’s picture

Aggregate and compress CSS files work for me.
You save my days.

zakir.gori

Nehbur’s picture

Hello, I had a similar problem. My site kept giving an old template file. Any change that I made in the page.tpl.php file kept being ignored. I was bashing my head on several items available around me for quite some time. Thought it had to do with caching. Did everything to disable caching on a server level also.

What was it then? Well, human error of course. I accidentally uploaded an edited template file in the CSS folder. Drupal scans folders and subfolders and the first page.tpl.php it found, it used, completely ignored the template file in the dedicated template folder.

What the use is for this Drupal feature I don't know, perhaps to give the freedom of having an own folder structure, but then again, who needs a different folder structure... Costed me at least 2 hours.

jiddisch’s picture

If you disabled boost module, be sure to delete the physicle cache folder

sujies’s picture

I ve cleared all the caches, Disabled the color module, And renamed the CSS file.
But drupal still shows the legacy CSS file!

rodmarasi’s picture

i get the solution. just delete all files under /cache at root directory. it takes me few hours to figure this out.

belajar drupal, makan drupal, tidur drupal

sjk1000’s picture

The only solution that worked for me is uploading the CSS expanded rather than compressed.

Gung Wang’s picture

– The new responsive CSS doesn't work in Firefox, Chrome, Edge
– It works good in Opera

I tried all methods I could find on Drupal Forum to refresh the CSS, but failed.

Final solution after four hours debugging:

-- Edit the html.php.tpl
-- Changed the code

Old code:   <link rel="stylesheet" media="all" href="/sites/all/themes/kith/css/responsive.css?id=1" />
New code:   <link rel="stylesheet" media="all" href="/sites/all/themes/kith/css/responsive.css" />

-- Works
See details on my post: https://www.drupal.org/node/1748028#comment-10455099

Jaypan’s picture

Well the problem here is that you are adding your CSS directly through a template, which isn't the way to do it in Drupal.

computer_jin’s picture

Any solution for this?
I am also facing the same issue.

--
Azhar uddin
Technical Lead
email : engr.azharuddin@gmail.com
skype : computer_jin

philip_stier’s picture

Have you checked to make sure that your them is enabled and set to default? To go further from that, have you also named your theme folder the same as the .info file, and made sure that your template.php file has the correct theme name in any instance that the theme name is being referenced?

faruq1256’s picture

Hi,

If your using Cloudflare, purge the cache from cloudflare to reflect the css changes. You can also set the page rules to Bypass the cache at cloudflare

Thank you
Faruq Shaik

darri’s picture

I was having *exactly* this problem and fixed it after about an hour of testing various cache flushing options in the admin, restarting the server, clearing browser caches etc.

SOLUTION:
Go to the root of your drupal installation and into the cache folder. Delete all files in there. Reload the page and the css should hopefully be there, updating with the fresh version whenever it is saved.

megan_m’s picture

Another thing to check is your browser's caching settings. In Chrome's developer tools there is a checkbox under the Network tab to disable the cache.

I was having lots of problems with Drupal 8 not picking up changes to CSS or images - that Chrome setting was the culprit.

Woolwich Web Works: Custom web development

Bahson’s picture

my new styles only get applied when I restart everything ,server,browser; tried clearing all cache severally, css aggregation is off. Which there was a solid solution around this.

jeramy’s picture

I have a workaround. I was unable to get my wysiwyg css to update despite clearing all caches, including varnish and browser. I found where my css was being called in the theme, in my case it was in the theme.info.yml file, and I added an argument to it. I just used today's date. So using myself as an example, 'css/wysiwyg.css' became 'css/wysiwyg.css?20170807'. I pushed this change, cleared caches, it caused it to reload the css and display the expected results. I am not sure where the old information is getting hung up, but this resolved the issue for me.

kdorwick’s picture

Hello, all. I think I have a fix for the CSS not being read. I was having ALL SORTS of trouble with my theme CSS (Skeletontheme, but also Garland and Stark as tests) simply not being read: if CSS Aggregation was off, I got just the Drupal CSS, nothing from the theme, so my theme colors, site logo and fav.ico were all missing; if it was on, I got no CSS at all, just the links with nothing, just basic formatting, the white page of death.
,
Other things were happening; I don't even think I can list them all but, remembering that Skeleton is a responsive theme that toggles between tabs on a desktop/laptop (screen wider than 760px by default) and a pulldown menu (less than 760px by default), here are some:

  • The pulldown menu wouldn't appear in situations it should
  • The colors were default Drupal, not the colors of the theme
  • The shortcuts would appear on a desktop or laptop but not on my cell phone (that is, the responsive adaptation had been triggered and was missing the block that held the shortcuts)
  • The custom fav.ico would not appear. Depending on the browser (I test on many, many browers: 4 on laptops, 3 on Android), I would either get a blank where the .ico should appear or Marvin making a guest appearance
  • The custom site logo would not appear; instead, the alt text (Default "Home") would display

And the longer and more often I refreshed the site, the worse things got--things went missing not all at once, but bit by bit, but once they were gone, they were gone.

So, on a clean install of the Drupal database, the Drupal Core (7.56, the most recent at the time), the theme (again, the most recent) and all the modules in sites/), I did a update.php, restored my database via the Backup and Restore Module and ... no change, everything wrong.

So then I cleared the caches, ran Cron, checked configuration including the file path (sites/default/files; the location of the modules and theme (sites/all/modules and sites/all/themes); and then I did something new.

Rather than using the upload button in the theme to install the custom site logo and the custom fav.ico, I FTP'd them to where they should be (sites/default/files/) and then changed the paths in the theme control panel, hard coding them as sites/default/files/logofilename.png and sites/default/files/ico.ico (sample fake names).

Then I cleared the caches using the button on the performance page--and when I went to the home page, the entire site refreshed itself (which is what it is supposed to do after a cache flush), and everything worked including getting the colors right, the custom logo and ico right, and even the shortcut menu back on my phone.

Further, when I checked, I found out the CSS Aggregation option had checked itself on, with no missing CSS and everything looking just the way it should.

I guess something was wrong with the default paths as saved by Upload button in the theme that was making it impossible to find my site logo and fav.ico, but also the paths to the CSS which basically broke the theme. Anyway, that's the fix. I hope it helps.