Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal 7 theme settings in mysql

I am new to Drupal and have been experimenting with some free themes. After installing one free theme called 'tb_sirate' my site is throwing exceptions and my admin controls are no longer available, just a page full of exceptions. Unfortunately, there is no obvious way to undo this.

It seems I have two choices to rectify this. First (and hopefully this is not my only option) is to start over completely. Second, if I could find where the theme is referenced in the database, I might be able to change it back to a known working theme.

Can anyone offer and advice on how to fix this? Anyone know where in the DB the themes are referenced?

Thanks! Viv

like image 986
Pheepster Avatar asked Apr 13 '26 12:04

Pheepster


1 Answers

Don't worry there are only 3 simple steps to recover your site. Here are the steps and corresponding SQL queries you can run. If you run the 3 queries this will change your default theme from the "tb_sirate" to "bartik" the Drupal 7 default.

1) In the "systems" table change the status to "0" for the record that represents the defective theme. Note that there is one row here for each module/theme. With the status variable "0" means disabled, and "1" means enabled.

UPDATE system SET status=0 WHERE name='tb_sirate'

2) In the "variable" table find the key "theme_default" and change it's corresponding value to the theme that you want to use.

UPDATE variable SET value='s:6:"bartik";' WHERE name='theme_default';

3) Drupal caches these values so you will need to clear the "cache_bootstrap" table for the changes to take effect.

TRUNCATE TABLE cache_bootstrap;

To avoid similiar problems and to able to have peace of mind regular database backups are essential when doing Drupal development. The backup and migrate module can help with that.

like image 190
Thomas4019 Avatar answered Apr 15 '26 00:04

Thomas4019



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!