Parameter 1 to theme_field() expected to be a reference, value given in /opt/lampp/htdocs/bms/networksna/includes/theme.inc on line 171.

I've followed the guide from going from a test environment to a production found here: http://drupal.org/creating-drupal-test-sites

I moved to a new host, not a new directory as the guide does. I created a new DB and imported. I copied the web files and edited settings.php. I see my site data but this theme.inc error appears on nearly every page.

After logging in I receive 10 of these errors:
warning: Parameter 3 to block_user() expected to be a reference, value given in /opt/lampp/htdocs/bms/networksna/includes/module.inc on line 386.

Administer-> Status report fails to load anything. HTML Source is empty but server response headers are still sent.

Unfortunately I can't find anyone else with this error. Anyone have any ideas?

Comments

ryan.nauman’s picture

I believe this is because the new environment has PHP 5.3 instead of 5.29 like the old environment. People have commented on this being a problem with Drupal 6.x but no one mentions Drupal 5.x with these compatibility issues. Can anyone comment?

ryan.nauman’s picture

PHP 5.29 solved this

truebluejw’s picture

I'm having the same exact errors. This is after upgrading php as well to 5.3.0. What needs to be done to stop these errors?

yan’s picture

I get the same error after an upgrade to PHP 5.3 with Drupal 5.21:

Parameter 1 to theme_field() expected to be a reference, value given  in /includes/theme.inc on line 171.

Any more ideas how to solve this?

naught101’s picture

upgrade to drupal 6 or 7

Lios’s picture

I just migrated and have this same issue. Is there a solution?

CovertHolistic’s picture

Hi, just had this same problem - though in the opposite way to how most people encountered it I imagine!

I was copying a live site (running PHP 5.2.14 Drupal 5.19) to my dev environment (running PHP 5.3.1) and found this situation.

I opened the file 'sites/all/modules/cck/content.module', and went to line 1044:

function theme_field(&$node, &$field, &$items, $teaser, $page) {

changed it to:

function theme_field($node, $field, $items, $teaser, $page) {

Seems to do the trick. Not exactly sure why, but might at least remove the warning messages while we figure it out!

mvc’s picture

Your solution looks exactly right to me.

I've posted a patch with an explanation of why I think it's right in the CCK issue queue: #914268: PHP 5.3 bug in theme_field()

keypetery’s picture

Host (5dollarhosting) upgraded php/mySQL version, but this solution (and related patch) worked for me. Thanks!

astra’s picture

My site under Drupal 4.7 have the same problem after upgrading to php 5.3:

Parameter 1 to theme_field() expected to be a reference, value given in .../includes/theme.inc op lijn 166.

Go to modules/cck/content.module, and change the line ( line 890 for D4.7, line 1044 for D5):

function theme_field(&$node, &$field, &$items, $teaser, $page) {

with new one:

function theme_field($node, $field, $items, $teaser, $page) {

It seems to fix the problem.

mulaysmara’s picture

I m about to upgrade a website, I have Drupal 5.x installed and I have the same error.
Would I be able to upgrade to Drupal 6.x without fixing such errors????