Skip to content

Instantly share code, notes, and snippets.

@josephmosby
Created September 9, 2013 20:41
Show Gist options
  • Save josephmosby/6501213 to your computer and use it in GitHub Desktop.
Save josephmosby/6501213 to your computer and use it in GitHub Desktop.
A brief description of some database surgery on theme files in Drupal 6.

Theme Database Surgery with Drupal 6

Occasionally a Drupal 6 theme will refuse to budge, despite any attempts to force a theme update. I came across this problem while attempting to modify my theme.info file to add a few additional JS files. Saving the theme configuration did not work, nor did clearing the database cache.

The following step did work, however:

  1. Access the database through phpmyadmin. Theme information is stored in the 'system' table with a type of 'theme.'
  2. Hunt down the theme entry in question.
  3. Edit the theme's info. This JSON entry is architected in the following manner: a. Keys with the type "a:x" where x is an integer indicate the number of entries in the following hash table. b. Keys with the type "s:x" where x is an integer indicate the length of the string that follows. c. As such, a standard theme entry might be formatted as follows: "a:2:{s:4:"name";s:5:"theme";}"
  4. The "a" and "s" parameters must be accurate to the digit, or the theme will not reload.

This is database surgery and can corrupt your entire theme (which could be problematic if your root problem is that the database isn't being updated from the .info file), so make sure to save a copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment