By A Drunken Theory on
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
CLOSED
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. :-)
Still have these errors
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...
same problem.
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):
No template overrides, or something. Just plain Drupal 7.
And I got the following PHP notices:
Removing
engine = PHPTemplatedidn't work.I had to remove the occurences of
highlighted,sidebar_firstandsidebar_secondin 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 notices?Its not checking if there is
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.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
correct way?
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?
...
You should override page.tpl.php and remove them.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Aye, thanks!
Alright, thank you Jeff Burnz :)
The correct way
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