Agaric Design Collective

Switch to a working theme via the database after deleting a theme leads to WSOD

By Benjamin Melançon
on 12 Mar
0 comments

Key words and phrases

command line cli sql rescue restore theme bash

Tags

Description

OK, maybe there are other situations where this can come up but in this case my esteemed colleague deleted the only enabled theme. This resulted in a White Screen Of Death (WSOD). A database fix was about as fast and more what was wanted (the deletion was intentional, just not the WSOD) than rolling back to a version with that theme (called mydeadtheme here to protect the innocent).

From the command line on your test server or local development environment:

mysql -u root -pMySEcretPass
If your username and password is correct (it doesn't have to be root; in fact you can use the MySQL username and password in your settings.php or db.php file) you will be greeted with the mysql prompt, mysql>.

SHOW DATABASES;
USE drupal_mydatabasename;
SELECT name, status FROM system WHERE type='theme';
UPDATE system SET status=1 WHERE name='garland';
UPDATE system SET status=0 WHERE name='mydeadtheme';
TRUNCATE cache;
TRUNCATE cache_page;

That was it. You have your site back. Not sure everything was necessary. And everything after the first command was at the mysql> prompt of course.

Then you can EXIT; to return to your shell.

 

Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <small> <pre> <strike> <sub> <sup> <kbd> <s>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.