Upgrading Zen

Last modified: June 1, 2008 - 16:30

Upgrading to Zen 6.x-1.0-beta2

…from Zen 6.x-1.0-beta1

If you followed the directions for creating a sub-theme, you will NOT have edited any files in the Zen directory and should only have modified files in your sub-theme's directory. So upgrading to the latest Zen will be easy.

  1. If you are replacing the Zen theme on a live server, place your site in maintenance mode.
  2. Download the latest Zen from http://drupal.org/project/zen
  3. Remove the zen folder from your Drupal installation.
  4. Unpack the downloaded file and place the new zen folder in your Drupal installation in the same place as the previous zen theme used to be.
  5. Turn off maintenance mode.

Upgrading to Zen 5.x-1.1…

…from Zen 5.x-1.0

If you followed the directions for creating a sub-theme, you will NOT have edited any files in the root of Zen and should only have modified files in your sub-theme's directory. So upgrading to the latest Zen will be easy.

  1. If you are replacing the Zen theme on a live server, place your site in maintenance mode.
  2. Download the latest Zen from http://drupal.org/project/zen
  3. Rename the zen folder in your Drupal installation to zen-old.
  4. Unpack the downloaded file and place the new zen folder in your Drupal installation next to your zen-old folder.
  5. Move your custom sub-theme folders from zen-old/ to zen/.
  6. Delete the zen-old folder. (Or at least move it out of the Drupal installation directory.)
  7. Turn off maintenance mode.
  8. To complete the upgrade, edit the following items in your sub-theme:

#199682: 'Submitted by' text is shown for content even if setting is disabled

Edit your sub-theme’s theme-settings-init.php files and change:

<?php
 
// Save default theme settings
 
variable_set(
   
str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
   
array_merge($defaults, theme_get_settings($theme_key))
  );
?>

to:

<?php
 
// Get default theme settings.
 
$settings = theme_get_settings($theme_key);
 
// Don't save the toggle_node_info_ variables.
 
if (module_exists('node')) {
    foreach (
node_get_types() as $type => $name) {
      unset(
$settings['toggle_node_info_' . $type]);
    }
  }
 
// Save default theme settings.
 
variable_set(
   
str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
   
array_merge($defaults, $settings)
  );
?>

#248780: admin table styles override update_status styling

Edit your subtheme.css and change:

  1. div.warning, tr.warning to div.warning, tr.warning, body.section-admin tr.warning
  2. div.error, tr.error to div.error, tr.error, body.section-admin tr.error
  3. all .section-admin #content … declarations to .section-admin … declarations.

#246110: zen.css breaks .container-inline

Edit your subtheme.css and, just before the .tips declaration, add:

  .container-inline div, .container-inline label /* Inline labels and form divs */
  {
    display: inline;
  }

#247960: Add THEME_preprocess() hook to Zen

Edit your sub theme’s template.php file and add:

/**
* Override or insert PHPTemplate variables into all templates.
*
* @param $vars
*   A sequential array of variables to pass to the theme template.
* @param $hook
*   The name of the theme function being called (name of the .tpl.php file.)
*/
/* -- Delete this line if you want to use this function
function STARTERKIT_preprocess(&$vars, $hook) {
  $vars['sample_variable'] = t('Lorem ipsum.');
}
// */

Upgrading to Zen 5.x-1.0…

…from Zen 5.x-1.0-beta1 or later

If you followed the directions for creating a sub-theme, you will NOT have edited any files in the root of Zen and should only have modified files in your sub-theme's directory. So upgrading to the latest Zen will be easy.

  1. If you are replacing the Zen theme on a live server, place your site in maintenance mode.
  2. Download the latest Zen from http://drupal.org/project/zen
  3. Rename the zen folder in your Drupal installation to zen-old.
  4. Unpack the downloaded file and place the new zen folder in your Drupal installation next to your zen-old folder.
  5. Move your custom sub-theme folders from zen-old/ to zen/.
  6. Optionally, compare the files in zen/STARTERKIT/ with the files in zen-old/STARTERKIT (or old/SUBTHEME if you have one.) If you see any changes, you can apply them to your custom sub-themes.
  7. Delete the zen-old folder. (Or at least move it out of the Drupal installation directory.)
  8. Turn off maintenance mode.

…from a version of Zen before 5.x-1.0-beta1

Upgrading a theme that you have modified can only be accomplished by looking at each file and carefully merging the files from the latest Zen into your theme. This is such a pain in the ***, that Zen 5.x-1.0-beta1 was specifically designed to be easily updatable.

Good luck. You’re going to need it.

If I'm not mistaken...

NikLP - April 21, 2008 - 13:50

(under a 1.0 -> 1.1 conversion)

...I believe that you can simply replace the old theme-settings-init.php with the new one, if you have not altered the one in the subtheme?

 
 

Drupal is a registered trademark of Dries Buytaert.