Notice: Undefined variable: site_logo en include() (línea 81 de .../sites/all/themes/genesis/genesis/templates/page.tpl.php).

that after ticking the logo and other stuff off...

(Yes, I like to have full control about the page settings, like making blocks that can make header, menus, etcetera)

CommentFileSizeAuthor
#7 genesis-define-vars.patch1.41 KBJeff Burnz

Comments

Jeff Burnz’s picture

Good timing, I'm working on G7 today/tomorrow. Will sort it out...

memcinto’s picture

This turns out to be an error in the naming of the variable. It is $site_logo and it should be $logo. What I did on my test install was to copy page.tpl.php into my subtheme folder, then change all instances of $site_logo to $logo. That fixed it.

Argus’s picture

Don't know if it has anything to do with it, but I did the same as #2 and indeed got rid of the error messages. But now I can't get the site logo to work. I end up with:

<h1 class="logo-site-name"><span id="logo">http://localhost/sites/all/themes/genesis_themename/logo.png</span></h1>

Jeff Burnz’s picture

#2 is wrong, it just needs the variable to be initialized properly, I will add a fix today.

Vidus’s picture

Hi, it seems I'm getting a variation of this error when I have logo turned off with the latest seven build:

Notice: Undefined variable: site_logo in include() (line 87 of /home/rhetorik/public_html/beta/sites/all/themes/genesis/genesis/templates/page.tpl.php).
jpincas’s picture

Version: 7.x-1.x-dev » 7.x-1.1

I'm having the same problem after turning the logo off. Here are my errors:

Notice: Undefined variable: site_logo in include() (line 87 of /home/jpincas/spanishfoodworld.co.uk/themes/genesis/genesis/templates/page.tpl.php).
Notice: Undefined variable: site_logo in include() (line 90 of /home/jpincas/spanishfoodworld.co.uk/themes/genesis/genesis/templates/page.tpl.php).
Notice: Undefined variable: site_logo in include() (line 93 of /home/jpincas/spanishfoodworld.co.uk/themes/genesis/genesis/templates/page.tpl.php).

Jeff Burnz’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.41 KB

I thought I fixed this, hmmm, heres a patch for CVS, I'll commit this but probably won't roll a new release until after the Git migration (in about a week).

jpincas’s picture

Thanks Jeff - I'll test this shortly. Jon

Rix-1’s picture

I really need help with this, I have been building a site that I was hoping to go live today however am having the same problem: "Notice: Undefined variable: site_logo in include() (line 87 of ...."

I appreciate the patch above however I'm not sure how to patch something and after reading the Drupal documentation it says something like ' if you don't know how to patch then don't'.

Could someone point out how to fix this or what I need to do my end to remove the error from my Genesis sub-theme?

PS - Loving the Genesis framework, I've been through a few and this is by far the best.

Jeff Burnz’s picture

In template.php (Genesis core) you can paste this into genesis_preprocess_page(), starting around line 73 (you need to overwrite what is already there for site name and logo), what this does is just adds else {} statements to both the site_name and site_logo variables, so even if they're empty they're still defined:

  // Set variables for the logo and site_name.
  if ($vars['logo']) {
    $vars['site_logo'] = '<a href="' . $vars['front_page'] . '" title="' . t('Home page') . '" rel="home"><img src="' . $vars['logo'] . '" alt="' . $vars['site_name'] . ' ' . t('logo') . '" /></a>';
  }
  else {
    $vars['site_logo'] = '';
  }
  if ($vars['site_name']) {
    $vars['site_name'] = '<a href="' . $vars['front_page'] . '" title="' . t('Home page') . '" rel="home">' . $vars['site_name'] . '</a>';
  }
  else {
    $vars['site_name'] = '';
  }

I have committed this fix to dev, so it should be in there in the next 24 hours or so, note that 7.x-2.x (the newer HTML5 version) does not have this problem at all, because it does things slightly differently.

Rix-1’s picture

Wow that was the fastest response ever!

I followed your instructions and it worked - thanks, I owe you a beer.

benjarlett’s picture

Status: Needs review » Fixed

I do too.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Screenack’s picture

FYI -- seeing this in Genesis 7.x-1.1 added the above #10 as described and this fixed the problem.

ASMBL’s picture

Version: 7.x-1.x-dev » 7.x-1.1

Also saw this error in 7.x-1.1. Also fixed with snipet in #10.

Thanks for the fix.

Tecnico informatico’s picture

Hello,

Sorry, someone could indicate in more detail as you deploy the patch.
Specifically what is to be replaced within "template.php"?

Thanks in advance.

Manuel.

Tecnico informatico’s picture

Hello,

I have the error:

"Notice: Undefined variable: site_logo in include ()"

The patch does not work because I do not know how it is implemented?

That line should be replaced with "template.php"
I do not know php.

Thanks in advance.

ivanhelguera’s picture

I can confirm this bug still happens in genesis-7.x-1.1.

@maligix :
you open template.php in your faveourite text editor, you find the two if statements around the line 73, and you replace them with what's shown here above (you paste the text form the codebox).
Important: do not paste the first (with "?php")nor the last line at the beginig of the above nor the "?" at the end. It's just an indication that the code is php, and what you paste into is a file full of php anyway (which has such statements at *its* beginning and end).

balavurda’s picture

I've been having the same problem. Suggested fix wasn't working for some reason. Fixed it a bit differently:
1. Go to page.tpl.php of your subtheme
2. On the line pointed as erroneous change if($site_logo... to if(isset($site_logo)...
Works fine with the logo on or off.