Search code examples
drupaldrupal-7

Drupal upgrade from 6 to 7 undefined variables


When I tried to run update.php as per instructions at http://www.siteground.com/tutorials/drupal-tutorial/drupal_upgrade.htm a long list of errors started appearing.

Notice: Undefined variable: head in include() (line 8 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: head_title in include() (line 9 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: styles in include() (line 10 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: scripts in include() (line 11 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: left in include() (line 16 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: right in include() (line 16 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: header in include() (line 19 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: left in include() (line 60 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: mission in include() (line 69 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: tabs2 in include() (line 73 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: help in include() (line 75 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: content in include() (line 77 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: footer in include() (line 80 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: footer_message in include() (line 80 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: right in include() (line 83 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php). Notice: Undefined variable: closure in include() (line 94 of /home/content/66/9070466/html/ehapsa/ehapsa/sites/all/themes/garlandcustom/page.tpl.php).

I was trying to upgrade under a subdirectory of current site.


Solution

  • Here is the solution. Custom regions must be printed differently in page.tpl.php

    In Drupal 6, when you wanted to print a region you had just made, you just put this into your page.tpl.php:

    print $foo_sidebar;

    In Drupal 7, all of the regions you wish to add must be printed using render and the page variable:

    print render($page['foo_sidebar']);