Since upgrading from Drupal 5.7, every one of my sites has a "0" in the head of every page in every theme. Somehow, the $head variable is passing this random text into the page header.

Here's how the HTML comes out:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">

<head>
  <title>CharlieHipHop | music and musings</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.charliehiphop.com/blogapi/rsd" />
0
<link rel="alternate" type="application/rss+xml" title="CharlieHipHop RSS" href="http://www.charliehiphop.com/rss.xml" />

etc.
Where is that "0" coming from? I think it's coming from $head. Why? And how do I get it out of there?

I have banged my head against the wall for hours on this. It could be a contributed module that's causing the problem, but I have turned off every module one-by-one, and the random zero persists.

phptemplate.engine doesn't offer any clue as to how to control what goes in the $head.

Anyway, just thought you should know.

Comments

dvessel’s picture

Component: theme system » other
Status: Active » Postponed (maintainer needs more info)

This doesn't look like a problem with the theme system. Could you disable all optional core modules too and see if it persists? Keep an eye on aggregator.module.

CharlieHipHop’s picture

Already did that. It persists.

Just out of curiosity, how would one control what's being passed by $head in Drupal 6.x? I don't like having " | Site Slogan" in the title of every page, either. It used to be part of an array in phptemplate.engine. Now I can't find my $head! Help!

I promise to let everyone know what was going on just as soon as I get this sorted.

Thanks for any suggestions.

CharlieHipHop’s picture

Update:

I'm attacking this by process of elimination. Installed a new site on the same multisite -- no "0" in any theme. OK, it's not the theme.

So I started enabling modules one by one, hoping the "0" would rear its ugly head. It never showed up. I line up all four sites in browser tabs, pointed at /admin/build/modules and begin going down the list to see if the three affected sites have any modules enabled that the unaffected site does not. There were a few. I disabled them one by one, to no effect.

It's not a theme issue (themes all work fine in the new site, working from same codebase) or a module issue. What could it be? Why is it happening in three sites but not one, and what might a possible solution be? It's really annoying, even though it doesn't seem to affect the performance of the sites and most people probably wouldn't even notice it.

jcamfield’s picture

I'm having this same problem; it showed up around the time I activated ViewsUI and was messing with Taxonomies and adding non-cck custom content types. It's definitely in $head, dropping that from the page template hides it (but I'd think would have other effects?? For the time being I've commented it out, as printing the whole string in the body showed it to just be "0".

http://drupal.org/node/332171 is a duplicate with less useful information of this error. This is a fresh-as-of-this-morning install, so it must be one of the modules I have running. I deactivated blogapi with no ill effects.

moochiku’s picture

I am in the same position as you guys ... found out a solution to this though but the solution could be on a case per case basis. On my site, the culprit is the sharethis module when it is in 'disabled' state. You need to go to the sharethis module settings page and enabled it. I think the '0' on top is a means of saying that the module is disabled(somehow). It will go away if you disabled the module altogether(in the module list, if you're not using it).

i guess, there's probably other modules that uses the same method to display its 'disabled' state ... so you might want to check into that if you dont have the sharethis module and are having the same kind problem.

jcamfield’s picture

Like moochiku says, the culprit is the ShareThis Module (which adds a javascript reference to $head) - the zero will go away once you set this module up (and enable it). FWIW, the shareThis module WILL NOT WORK if you comment out $head in the page.tpl!

jrowny’s picture

WOW! Thank you very much! That fixed it. I installed a bunch of modules (including Share This!) and freaked out. Google brought me here, I enabled ShareThis, and the problem is solved.

dave reid’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Sure enough, there is an issue in the ShareThis issue queue:
#302407: 1.3-1 puts a '0' in the HEAD section before it is set up.

I'm going to mark this as a duplicate of that issue.