Converting 4.1.x themes to 4.2.x

Required changes

Add a theme_onload_attribute() to a <body> tag:

<body <b><?php print theme_onload_attribute(); ?></b> >

Optional changes

Take advantage of settings() hook

Themes can now populate settings to adminstration pages using the function <em>themename</em>_settings(). Example:

function mytheme_settings() {
  $output  = form_select("Sidebar placement", "mytheme_sidebar",
             variable_get("mytheme_sidebar", "right"),
             array(
             "none" => t("No sidebars"),
             "left" => t("Sidebar on the left"),
             "right" => t("Sidebar on the right"));
}

Direct you site logo to index.php

If you theme has the logo and you have made it to link &lt;a href=""&gt; or even &lt;a href="&lt;?php print path_uri();&gt;"&gt; then please replace these instances with a simple &lt;a href="index.php" alt=""&gt;

One additional change may be needed. Using a custom theme adapted from a generic one, the original node function has the following code:

<?php
    $terms
= array();

    if (
function_exists("taxonomy_node_get_terms")) {
       if (
$terms = taxonomy_node_get_terms($node->nid)) {
        
$taxlinks = array();
         foreach (
$terms as $term) {
           
$taxlinks[] = l($term->name, array("or" => $term->tid), "index");
         }
      
$taxo = $this->links($taxlinks);
       }
    }
?>

Which gaves an error on the index page after upgrading from 4.1 to 4.2 and contains invalid URLs. Replacing the above code with this fixes the error.
<?php
$terms
= array();

    if (
module_exist("taxonomy")) {
       
$terms = taxonomy_link("taxonomy terms", $node);
    }
   
$taxo = $this->links($terms);
?>

 
 

Drupal is a registered trademark of Dries Buytaert.