PDA

View Full Version : Fatal error: Cannot pass parameter 1 by reference


BirdOPrey5
10-19-2010, 01:46 PM
I'm getting this error:

Fatal error: Cannot pass parameter 1 by reference in /***file path removed***/includes/class_postbit.php(294) : eval()'d code on line 33

Line 33 in class_postbit.php is blank. the few lines around it are:

* Bitfield value which determines whether a user's reputation power should be displayed with their post.
*/
define('POST_SHOW_REPPOWER', 2);

/**
* Bitfield value which determined whether a user sees another user' infractions
*/
define('POST_SHOW_INFRACTION', 4);


Reputation and infractions have nothing to do with what I'm working on...

I added a plugin to postbit_display_compelete to try out some code that isn't working but not sure why... the offending lines are:


include('functions_forumlist.php');

$sico = fetch_forum_lightbulb(2, array(), 2);


I'm guessing the problem is one of the parameters of the function but I don't see why this is a problem... in the code in forumlist.php the function takes an int, an array, and an int... the ints are forumid's... The purpose of this function is to get the info on whether there are new posts in that forum.

Lynne
10-19-2010, 01:56 PM
Joe,

This line...
includes/class_postbit.php(294) : eval()'d code on line 33How to read....
File: class_postbit.php
Line: 294 of class_postbit.php

That is most likely a plugin and then you need to look at line 33 of the plugin. Trick there is that sometimes there are several plugins using that hook and you don't know which line 33 is. You can look at the datastore table and find the row with the plugin stuff and look there, if needed.

BirdOPrey5
10-19-2010, 02:10 PM
ahh thanks... good to know.

Simon Lloyd
10-19-2010, 05:09 PM
Joe, if you google Max beauty, download it and then when you view the page of your forum that causes the error, right click, view source and max beauty will open with the source code for everything used to render that page and line numbers, also before you do this turn on template headers/titles in your admincp so you can see which piece of code is being called from which template :)

Hope that helps.

BirdOPrey5
10-19-2010, 07:52 PM
I'll take a look at max beauty thanks...

The reason for this particular error was that I hard coded the forum id's in the function call... even though the function takes integers it requires they be in variables... once I set them to a couple of variable names the error went away. :up:

Simon Lloyd
10-19-2010, 08:27 PM
Cool!

Oh, you might like this for comparing text too http://diffchecker.com/index.php?action=diff

BirdOPrey5
10-19-2010, 09:10 PM
thanks... looks interesting for quick checks... I already have WinMerge which does basically the same thing.