I am getting this error after transferring my site to another host. Not sure why it broke so need some help troubleshooting.

enter image description here

It seems the block_html_id and the content itself is not coming through. I am using the standard block.tpl file What could be wrong?

here is the code from simplenews-block.tpl.php

47:     <div id="<?php print $block_html_id; ?>" class="<?php print $classes; ?>"<?php print $attributes; ?>>

50:    <php if ($block->subject): ?>

56:       <?php print $content ?>

Here is all the code from the simplenews-block.tpl.php

<div id="<?php print $block_html_id; ?>" class="<?php print $classes; ?>"<?php print $attributes; ?>>

  <?php print render($title_prefix); ?>
<?php if ($block->subject): ?>
  <h2<?php print $title_attributes; ?>><?php print $block->subject ?></h2>
<?php endif;?>
  <?php print render($title_suffix); ?>

  <div class="content"<?php print $content_attributes; ?>>
    <?php print $content ?>

I am thinking I need to delete the module and all tables related to it in the DB and start fresh...? What else is there to do?

This is the content of the template.php file.

  • I frequently find Quick-and-Dirty debugging useful in understanding what modules cause problems. It requires some work to understand how to make us of this, so I consider it a comment rather than answer. – Letharion Feb 27 '12 at 20:42
  • Would help if you post the code where error is thrown (Line 50 & 61) – GoodSp33d Feb 28 '12 at 11:53
  • For the reason as to why this happened on one server and not another, I think you ran into the same problem I described in drupal.stackexchange.com/questions/23246/… – mpdonadio Feb 28 '12 at 23:42

I have no clue where you got that block template content from, but that's completely wrong and not what Simplenews comes with.

The Simplenews block template can be seen here: simplenews-block.tpl.php. What you seem to have there is the default block.tpl.php which is not the same thing, even though they are named in a similar way.

Make sure that you are not overriding the default template somwhere (and if you do, use the correct one as the start point) and that you are using an unmodified, recent version of Simplenews.

Edit: Looking at the error message again, it looks like you already overwrote the template with something that is wrong. This your problem. Just delete that file, clear your caches and everything should be working again.

  • Oh! of course that would make sense. How do I use the code in the link? Can you link me to an example of the correct file...? Sorry new with drupal and don't really understand how all this works. The link doesn't appear to be a file...? – KenAesthetic Feb 28 '12 at 22:56
  • @KenAesthetic: See my edit, you don't need to use any code, simply delete that file, it's just wrong. – Berdir Feb 28 '12 at 23:02

Clear your cache completely. Disable your current them and enable a core theme like Garland. If the error goes away, you'll know it's with your theme.

If not:

  • Was the database fully migrated?
  • Were your files (and theme!) fully migrated?
  • When you say "standard" block.tpl.php file, where did it come from? It should have come from /modules/block/block.tpl.php.
  • Ok it is the theme. But I don't understand why I am testing it in one place and it works but the new location it doesn't? Everything is the same. What could have happened. The DB was fully migrated I double checked, I reset the simplenews.tpl.php file with block.tpl.php from the location described above and theme + file were all migrated correctly. I tried reinstalling the module but nothing changed. What do I do to fix this? – KenAesthetic Feb 28 '12 at 5:55
  • How is the PHP error reporting on your production environment ? Sometimes, some PHP error may be hidden. Also, you could check in the site log to see if some error happened before this one. – Countzero Feb 28 '12 at 11:00
  • Perhaps there is a preprocess function in your template.php that is not setting (or unsetting) this variable. Can you post the contents of your template.php to pastebin.com? – Charlie Schliesser Feb 28 '12 at 14:39
  • Thanks Charlie S here is the link: pastebin.com/d5YSeGmj – KenAesthetic Feb 28 '12 at 16:53
  • Huh, that looks fine. Nothing overriding any block functions. Can you post the contents of simplenews-block.tpl.php? – Charlie Schliesser Feb 28 '12 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.