The S-Files: "Help I deleted my theme"
Tech Support Case Studies
One of the core services that Acquia offers is support for people building sites with Drupal. "The S-Files" are stories about the day-to-day life of our support team. Each one contains a nugget of Drupal knowledge that helped a customer succeed with Drupal. Enjoy!
"Hello, I installed a new theme on my site but I didn't like it. So I deleted it. Now I can't log into my site and it really looks broken."
That's the message that appeared in my email inbox. It was a voicemail message that a customer had left after calling our support hotline: 888.9.ACQUIA. Using my voice-over-internet softphone I dialed the number that the customer had left. Initial response time - 8 minutes.
The symptoms were as he had already described. After deciding not to keep the new theme he had simply deleted the folder from the sites/all/themes directory. The pages, which were still being served from Drupal's page cache, had the markup of the deleted theme (cached), but no images or CSS. This was, of course, very confusing. Here's the way to handle the situation:
- Go to http://example.com/?q=user and log in. You may have to type this into your browser as one of the side effects of killing your theme is the absence of navigation links.
- Go to http://example.com/?q=admin/build/themes and select one of the existing themes. Enable it and make it your default theme.
When you visit admin/build/themes Drupal re-scans the directory where themes are kept and notices if you have added or deleted themes. When it notices that the previously selected default theme is missing, it will pick another. At this point the site should look normal again.
In the future, the customer will now disable unwanted themes from the admin interface before deleting the files (this goes for modules, too). I also advised him to keep a short list of handy URLs (like the ones above) to get to various useful corners of the site in case something goes wrong in the future. Case closed!