I've been running a single Drupal site for some time, but recently I added a second site to the same code base (separate database). Since then, periodically, the first site will start loading only as plain text. The CSS and JS doesn't load, so blocks don't appear. There's only the front page text and the home page logo and title. I've found that if I clear the Drupal caches then that fixes it, at least for about a day.
Since my site does not get a ton of traffic I thought I'd add a cron job to clear the caches every day, just as a stopgap measure until I figure out how to fix it correctly. So I made a php file called "clear.php" to with the code below (found at http://drupal.org/node/42055):
<?php
include_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_flush_all_caches();
?>
So when this job runs as cron or from the command line (command below) it actually CAUSES the site to go to plain text mode.
/usr/local/bin/php -q /home/user/html/clear.php
If I then clear the caches using the button at /admin/settings/performance or go to www..com/clear.php it fixes it.
Through all of this, the second site is completely unaffected. From the code I assume this would flush the caches for all Drupal databases, not just the one that happened to be installed first. It may be because my default settings.php is setup for the first site. I do have a separate folder for that domain with its own themes and modules that aren't accessible by the 2nd site, so I thought it was no longer reading the default folder.
So I'm at a loss for what to do next. I'm no Drupal expert, so if I've set something up wrong regarding the multiple sites then feel free to advise me on how to fix it.
Thanks!
Comments
Bump! Anyone?
Bump!
Anyone?
It seems we have the same
It seems we have the same problem – at least, we share the same symptoms.
Maybe you could check in what directory you have placed your theme? I'm starting to suspect it only happens when the theme is not in the
sites/all/themesdirectory, but in a site-specific directory ...My theme is, in fact, in the
My theme is, in fact, in the sites/domain.com/themes directory, and not the all directory.
Have you tried putting the
Have you tried putting the theme into the
sites/all/themesdirectory? This seems to have solved my problem. IMHO, this is a bug that should be reported, if it isn't already. Edit: It is now.I did have it in the
I did have it in the sites/all/themes directory, but I can't any longer. I'm using two versions of the same theme for two different websites in the same Drupal codebase.
Yeah, I know.
Thanks for making the bug!
A silly question... Does it
A silly question... Does it happen on IE only or other browsers as well?
I don't know if it is
I don't know if it is happening with IE, but I see it with Google Chrome on Windows.
Ok. I thought it had to do
Ok. I thought it had to do with the CSS issue... Never mind. :)
It's not browser specific, it
It's not browser specific, it happens in Safari (for Mac OS X 10.6.4) as well.
Are you using views within
Are you using views within your nodes?
I have just come across similar problems. I had plain text (html formatted) being displayed, but no CSS and no page formatting by HTML, ie page.tpl.php
I tracked it down to content_type. I know I had only been developing a views query, and block display.
for me the problem came down to deleting a view in views, but some nodes referenced that deleted that view, and it was those nodes ONLY, that were being rendered in plain text only.
HTH
I had views on one of my
I had views on one of my sites, but not the other. This didn't start happening until the 2nd site was in development (the one with views).
Strangely, I'm not seeing it happen anymore. I'm still using Views, but a lot has changed on the new site.