I had been developing a theme on D7 RC2 and had it working, but when I installed it today on new D7 release there's some errors...

Main Errors
When viewing the Home Page

* Warning: include_once(/home/myusername/drupal.mysite.com/) [function.include-once]: failed to open stream: Success in _drupal_theme_initialize() (line 209 of /home/myusername/drupal.mysite.com/includes/theme.inc).
    * Warning: include_once() [function.include]: Failed opening '/home/myusername/drupal.mysite.com/' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in _drupal_theme_initialize() (line 209 of /home/myusername/drupal.mysite.com/includes/theme.inc).

Not as important
I've managed to get rid of these by defining the regions in the .info file, but I was under the impression that if I defined my own custom regions the default regions would be ignored / overwritten.
When in Admin Mode

    * Notice: Undefined index: highlighted in include() (line 121 of /home/myusername/drupal.mysite.com/modules/system/page.tpl.php).
    * Notice: Undefined index: sidebar_first in include() (line 133 of /home/myusername/drupal.mysite.com/modules/system/page.tpl.php).

Thanks

Comments

A Drunken Theory’s picture

I'm not sure why, but I've managed to get rid of all errors by removing the

engine = PHPTemplate

in the .info file. It worked fine with the release candidate but on the final release almost everything was receiving errors. I studied some of the other stock templates and noticed that line was omitted in some themes so I decided to give it a try and it worked - and now I can move on in development. :-)

mschouten’s picture

I did everyting that was necessary to update a drupal 6 theme to drupal 7,

Like you said, the engine should now be renamed from PHPTemplate to theme:
http://drupal.org/update/themes/6/7#engine

I dit this, but still i get these errors, so how do you overwrite regions in drupal 7?

Also my page.tpl.php in my custom theme isn't overwritting the default page.tpl.php in the system directory...

no2e’s picture

Have the same problem.
I created a new theme and added the following regions in my .info (if I'm right, that means: don't use the default regions, but only those 3; named the same way, however):

regions[header] = Header
regions[content] = Content
regions[footer] = Footer

No template overrides, or something. Just plain Drupal 7.
And I got the following PHP notices:

Undefined index: highlighted in include() (line 121 of /www/htdocs/…/drupal/modules/system/page.tpl.php).
Undefined index: sidebar_first in include() (line 133 of /www/htdocs/…/drupal/modules/system/page.tpl.php).
Undefined index: sidebar_second in include() (line 139 of /www/htdocs/…/drupal/modules/system/page.tpl.php).

Removing engine = PHPTemplate didn't work.

I had to remove the occurences of highlighted, sidebar_first and sidebar_second in page.tpl.php.

Why is that?

I thought that (for example) <?php if ($page['highlighted']): ?> checks, if there is a region like that … ?! Why does it give me those Undefined index notices?

Jeff Burnz’s picture

Its not checking if there is a region, its checking if there is anything IN that variable. PHP is throwing the notice because its not defined in the first place.

no2e’s picture

So if you don't want (some of the) default regions, it is the correct way to overwrite the default page.tpl.php to remove those unneeded regions? Or is this some kind of hackish, and should be done at a different place?

Jeff Burnz’s picture

no2e’s picture

Alright, thank you Jeff Burnz :)

rcastera’s picture

This error occurs when the variable has not been initialized.

So you should use isset() like this:

if (isset($page['highlighted'])):

You can read more about it here:
https://drupal.org/node/34341