Problems with cache after upgrading to 5.4
Permalink
Hey folks,
i got problems after upgrading to 5.4, but only with one particularly site. 8 of the sites i've upgraded are fine, one can't find the theme's css anymore.
A look into the page's source code, shows that the css relation isn't like it should be:
..disabling the cache seems to "solve" the problem.. but this can't be the solution
..curious is, that also the site with disabled cache shows this "/index.php/tools/css/.." in the path to the css.. but this site is displayed correctly..
i got problems after upgrading to 5.4, but only with one particularly site. 8 of the sites i've upgraded are fine, one can't find the theme's css anymore.
A look into the page's source code, shows that the css relation isn't like it should be:
<link rel="stylesheet" media="screen" type="text/css" href="/index.php/tools/css/themes/themename/main.css" /> <link rel="stylesheet" media="screen" type="text/css" href="/index.php/tools/css/themes/themename/typography.css" />
..disabling the cache seems to "solve" the problem.. but this can't be the solution
..curious is, that also the site with disabled cache shows this "/index.php/tools/css/.." in the path to the css.. but this site is displayed correctly..
The information you posted looks fine, at first glance. What do you think is wrong with the CSS references? Do you have pretty URLs turned on for the site? If so, have you defined URL_REWRITING_ALL to be true in config/site.php? Have you cleared the cache in c5? You might want to clear out the files/cache directory, as well.
i have seen this as well not sure whats causing it, clearing the cache (server and local) didn't do anything after playing around a lot i got it to find the css, but the images were not being found....
can't figure it out... and this was a fresh 5.4 install no upgrade, this is only with a specific theme, the other themes work fine, (custom made checked all paths)
can't figure it out... and this was a fresh 5.4 install no upgrade, this is only with a specific theme, the other themes work fine, (custom made checked all paths)
..strange, images are found correctly at my site.. you said you played around and got it to find the css, do you remember what you did?
The css reference of all our other pages shows the correct path to the css files, as they are placed in the web directory:
/themes/themename/typography.css
/themes/themename/style.css
On this site the path looks like this:
/index.php/tools/css/themes/themename/style.css
There is this /index.php/tools/css/ in front of the real path.
- i have pretty url on, yes
- URL_REWRITING_ALL isn't turned on
- i cleared the cache through the backend
and manually by deleting files in
/files/cache and /files/cache_objects
/themes/themename/typography.css
/themes/themename/style.css
On this site the path looks like this:
/index.php/tools/css/themes/themename/style.css
There is this /index.php/tools/css/ in front of the real path.
- i have pretty url on, yes
- URL_REWRITING_ALL isn't turned on
- i cleared the cache through the backend
and manually by deleting files in
/files/cache and /files/cache_objects
just some background information: There's a good reason why c5 doesn't include css files without index.php. C5 has a "theme customize" feature where you can set a few properties like colours and fonts.
These custom values must be included in the css file. This is why you have index.php and no direct links to you css files... Never causes any problems for me though
These custom values must be included in the css file. This is why you have index.php and no direct links to you css files... Never causes any problems for me though
..but do i need to include these properties even if i don't use the customize features?
When i look at all the other custom themes i've made, there is never the index.php in the path to css..
When i look at all the other custom themes i've made, there is never the index.php in the path to css..
no you don't have to use $this->getStyleSheet...
but it never caused any problems for me.
Can you attach your css file and post a link to your site so we can check the output?
but it never caused any problems for me.
Can you attach your css file and post a link to your site so we can check the output?
I would agree with Remo. The information you posted with index.php/css is correct. The css files are processed to allow customization before they are shipped out to the browser. Something else must be preventing c5 from finding the css files.
Check the common things like permissions on the directories/files. Do both files exist? Is it possible that there is an error in one or both of the css files? You can confirm that the problem is isolated to a particular theme by changing the theme on a test page to some other theme and seeing if it works.
If pretty URL's are on, I suspect that index.php shouldn't show up in the path. I will see if I can track down where that is happening and submit a patch.
Check the common things like permissions on the directories/files. Do both files exist? Is it possible that there is an error in one or both of the css files? You can confirm that the problem is isolated to a particular theme by changing the theme on a test page to some other theme and seeing if it works.
If pretty URL's are on, I suspect that index.php shouldn't show up in the path. I will see if I can track down where that is happening and submit a patch.
Patch not needed. If URL_REWRITING_ALL is defined as true in config/site.php, then the theme path will be created as a pretty URL.
- files are existing for sure
- permissions are correct
- there is no error in the css files
- there is no URL_REWRITING_ALL set in the site.php
- problem exist with pretty URLs on and off
The Problem is indeed isolated to this theme, standard themes are working.
- permissions are correct
- there is no error in the css files
- there is no URL_REWRITING_ALL set in the site.php
- problem exist with pretty URLs on and off
The Problem is indeed isolated to this theme, standard themes are working.
Take a look at themes/themename/elements/header.php. How is the path to the theme being constructed?
This is how the path is constructed, not different to all our correct working sites.
Also it worked fine bevor the upgrade.
Oops, I was working on my message above when you posted yours. I think there is a problem of some kind with your css file(s).
I don't think so, there is no obvious problem in the css files. It worked all fine before the update and when a turn caching of, the site is displayed correct.
The way to determine if there is a problem or not with the css files is to do the test I suggested. Create a test page with a different theme and see if that works. Then, change the theme on the test page to the standard theme and see if it still works.
If the different theme works and the standard theme does not work, it points to a possible problem with the standard theme css file(s).
If the different theme works and the standard theme does not work, it points to a possible problem with the standard theme css file(s).
..standard themes are working fine.. the problem only occurs with this custom theme and enabled cache..
..but what kind of failure in the css does only have effect in C5 5.4.0 and only with enabled caching?
I work with Aptana Studio wich should show every typo in the css.. and i never had a failure in a css which stops the webserver from reading it at all.
..but what kind of failure in the css does only have effect in C5 5.4.0 and only with enabled caching?
I work with Aptana Studio wich should show every typo in the css.. and i never had a failure in a css which stops the webserver from reading it at all.
Here is the path to the site:
http://dev.abp-beyerle.sbitskunden.de/...
CSS-files, default.php and header.php are attached.
http://dev.abp-beyerle.sbitskunden.de/...
CSS-files, default.php and header.php are attached.
It's hard to say what is happening without some low-level debugging. It is possible that the content of the css files is correct but that something else about the theme is not.
Is there anything unusual about the theme? Does the theme have the same name as a core theme, perhaps?
Is there anything unusual about the theme? Does the theme have the same name as a core theme, perhaps?
OK, I'm looking at the website.
Here's the problem. The css file doesn't exist (at least, at that location). Check your web server logs to confirm.
Connected to dev.abp-beyerle.sbitskunden.de. GET /index.php/tools/css/themes/abp-beyerle/main.css <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /index.php/tools/css/themes/abp-beyerle/main.css was not found on this server.</p> <hr> <address>Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 Server at sbitskunden.de Port 80</address> </body></html>
..ok thats the symptom, not the problem :)
..i'm using <?php echo $this->getStyleSheet('main.css')?> to determine the path to the stylesheet.. when i use absolute paths to the css, everything works fine..
..i'm using <?php echo $this->getStyleSheet('main.css')?> to determine the path to the stylesheet.. when i use absolute paths to the css, everything works fine..
So i found the solution. In every other theme i used <?=$this->getThemePath()?>/main.css instead of <?php echo $this->getStyleSheet('main.css'). It seems that getStyleSheet is no longer supported in 5.4.
Thanks for your help guys, really appreciate it.
Thanks for your help guys, really appreciate it.
Yes, getStyleSheet() is supported. If the user is allowed to customize a theme without changing the theme itself, then it must be called. Otherwise, getThemePath() can be used to include the css without preprocessing. There is something else going on.
what type of server are you hosting this site on?
..our own root-server, powered by Debian Lenny 5.0.4, PHP 5.2.6, Apache 2.2.9 with Suhosin-Patch and SysCP as management tool..
What is the external path to the core css directory? None of these exist.
/tools/css/
/index.php/tools/css/
/de/tools/css/
/de/index.php/tools/css/
/de/home/tools/css/
/de/home/index.php/tools/css/
If you have pretty URLs turned on, it shouldn't matter if index.php is included or not. This looks like a rewrite problem in your web server or a directory/file permissions problem.
/tools/css/
/index.php/tools/css/
/de/tools/css/
/de/index.php/tools/css/
/de/home/tools/css/
/de/home/index.php/tools/css/
If you have pretty URLs turned on, it shouldn't matter if index.php is included or not. This looks like a rewrite problem in your web server or a directory/file permissions problem.
I played with this some more, and it seems to be a rewriting problem with your website. There is something strange happening that you did not include in your messages.
dev.abp-beyerle.sbitskunden.de redirects to dev.abp-beyerle.sbitskunden.de/de/home/. The reference to the css is /index.php/tools/css/..., which becomes
http://dev.abp-beyerle.sbitskunden.de/index.php/tools/css......
but index.php doesn't exist at that location. The actual path appears to be
http://dev.abp-beyerle.sbitskunden.de/de/index.php/tools/css......
Most of the links on your website include /de. If "/de" is the root concrete folder, it should be defined as the relative directory in config/site.php.
The next odd thing is that the following path does resolve.
http://dev.abp-beyerle.sbitskunden.de/themes/abp-beyerle/main.css...
This would imply that the /themes directory exists at the same level as the /de directory (i.e., /themes is outside of the concrete root directory). That could explain why css.php cannot find the theme, but specifying the direct path to the theme with getThemePath() works.
You might want to check the concrete directory structure to make sure files and directories are in the right place (configure the relative directory site.php as appropriate). Look at the web server rewriting rules to confirm that they work properly.
Note that if you installed themes and then moved them, the location in the database will not match the physical location of the theme on disk, and c5 won't be able to find it.
dev.abp-beyerle.sbitskunden.de redirects to dev.abp-beyerle.sbitskunden.de/de/home/. The reference to the css is /index.php/tools/css/..., which becomes
http://dev.abp-beyerle.sbitskunden.de/index.php/tools/css......
but index.php doesn't exist at that location. The actual path appears to be
http://dev.abp-beyerle.sbitskunden.de/de/index.php/tools/css......
Most of the links on your website include /de. If "/de" is the root concrete folder, it should be defined as the relative directory in config/site.php.
The next odd thing is that the following path does resolve.
http://dev.abp-beyerle.sbitskunden.de/themes/abp-beyerle/main.css...
This would imply that the /themes directory exists at the same level as the /de directory (i.e., /themes is outside of the concrete root directory). That could explain why css.php cannot find the theme, but specifying the direct path to the theme with getThemePath() works.
You might want to check the concrete directory structure to make sure files and directories are in the right place (configure the relative directory site.php as appropriate). Look at the web server rewriting rules to confirm that they work properly.
Note that if you installed themes and then moved them, the location in the database will not match the physical location of the theme on disk, and c5 won't be able to find it.
/de is not a sub-directory in which C5 is installed, it's just the root of the tree for the german version of this site, in the C5 sitemap
C5 is installed in the vhost root underhttp://dev.abp-beyerle.sbitskunden.de... and there also is the index.php
This path to the css is correct:http://dev.abp-beyerle.sbitskunden.de/themes/abp-beyerle/main.css...
The theme wasn't moved after installing..
C5 is installed in the vhost root underhttp://dev.abp-beyerle.sbitskunden.de... and there also is the index.php
This path to the css is correct:http://dev.abp-beyerle.sbitskunden.de/themes/abp-beyerle/main.css...
The theme wasn't moved after installing..
The reason why /de/home is opened by entering the site is a dirty html redirect, which i placed in the index.html..
Hi guys,
I'm looking at a similar problem to the one dom had. The path to my theme's css now has 'tools' in it (index.php/tools/css/themes/themename/main.css) and I'm using the getStyleSheet code to call it. I need to get rid of the 'tools/css' part.
Did anyone find a reason for this and/or a solution apart from using getThemePath instead of getStyleSheet?
Many thanks in advance.
Sam
I'm looking at a similar problem to the one dom had. The path to my theme's css now has 'tools' in it (index.php/tools/css/themes/themename/main.css) and I'm using the getStyleSheet code to call it. I need to get rid of the 'tools/css' part.
Did anyone find a reason for this and/or a solution apart from using getThemePath instead of getStyleSheet?
Many thanks in advance.
Sam