PDA

View Full Version : [Fix How to] PHP 5 and array_merge errors


Brad
30 Aug 2006, 10:04
If you've upgraded to php 5 on your server you may have seen some of your plug-in's and add-ons throwing errors like this:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /index.php(486) : eval()'d code on line 79

This is a common error, we updated our server to php 5 yesterday and I've already seen the error come up twice for two plug-ins on our forum. Another site on the server is running vBadvanced, its news module also threw the same error.

The reason this came up is due to a change in the way array_merge works in php 5. Basically it will no longer accept anything but an array without throwing an error. Thankfully it's just an 'incorrect usage' error and our code still works as it should, it just throws an error now.

The correct way to fix this is not using array merge with anything but arrays. However we already have a lot of code lying around doing things like this:


$var = 'option1';
$array = array('option2', 'option3', 'option4');

$array = array_merge($var, $array);

Obviously most of us aren't looking to re-write some of this code just so it works under php 5. Thankfully there is a very simple fix for this that won't force us to change much of anything.

Just change your code so it looks like this:

$var = 'option1';
$array = array('option2', 'option3', 'option4');

$array = array_merge((array)$var, $array);

Notice the (array) next to $var now? That is the only change needed. Your code should now work under php 5 and no longer throw array_merge errors. :)

Abe1
16 Mar 2007, 06:13
If you do just this change? Will this script work for php4?

Danny.VBT
16 Mar 2007, 07:07
Yes, the fix is just type casting the value into the array, however, if you know that you are only adding other types of data on to the array, just use array_push() or $var[] = 'option1';



$array = array('option1', 'option2', 'option3');

$array[] = 'option4';

// or: (although $array[] = 'option4' is quicker)

array_push($array, 'option4');

deathemperor
19 May 2007, 10:20
this small fix helps :)

mystic10
11 Jan 2008, 22:44
i have the same problem but with functions.php

this is my error: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1259) : eval()'d code on line 5

i tried to look for the above things in fuctions.php but was unscusseful...maybe u can help me as well

Opserty
12 Jan 2008, 00:43
Argument #1 is not an array in /includes/functions.php(1259) : eval()'d code on line 5

i tried to look for the above things in fuctions.php but was unscusseful...maybe u can help me as well
eval()'d code normally refers to when a template/plugin is executed. Find the plugin(s) that use the hook in functions.php on line 1259, it will be on the 5th line of the Plugin PHP Code.

seangworld
18 Feb 2008, 07:25
im fn lost. this sh.it doesnt help when you cant find the stupid code at all. then what the hell is the option 1, 2, 3, 4???

allaf2
28 Feb 2008, 19:38
I have the same problem as mystic10 i get the same error and the error is this (array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1259) : eval()'d code on line 5) and i dont know what i should do or what to do can you plz help me

Brad
29 Feb 2008, 20:20
im fn lost. this sh.it doesnt help when you cant find the stupid code at all. then what the hell is the option 1, 2, 3, 4???
If you're having problems finding the code throwing the error you probably shouldn't be poking around in the files in the first place. At the very least you shouldn't be acting all high and mighty and calling my thread "shit".

Try asking nicely for help, and add a please, and include full error messages and I'll try to help you.

Yes I'm an ass hole, but only when provoked. I'm pretty friendly if you come at me with respect.

I have the same problem as mystic10 i get the same error and the error is this (array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1259) : eval()'d code on line 5) and i dont know what i should do or what to do can you plz help me

You have an error in one of your plug-ins at the hook located at line 1259 of /includes/functions.php.

Open functions.php and locate that line, on it you'll find a line of code similar to this one:

($hook = vBulletinHook::fetch_hook('hook_name')) ? eval($hook) : false;

In the above example "hook_name" is the name of the hook location we need to find.

Once you have the name of the hook location go into the plug-in manager in the admincp and find all plug-ins using that location. The code throwing the error is located in one of them.

dancue
17 Mar 2008, 06:35
This is my error:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /index.php(537) : eval()'d code on line 119

I've found the plug-in causing the error. I opened it saw an array and did as instructed above, but still received the same error.

Can anyone help me with this please?

Here is the code within the plug-in:
if($vbulletin->options['siteteam_active'] == 1) {
$userid = $vbulletin->userinfo['userid'];
$languageid = $vbulletin->userinfo['languageid'];
$user = $vbulletin->db->query_first_slave("
SELECT language.phrasegroup_siteteam AS phrasegroup_siteteam
FROM ".TABLE_PREFIX."user AS user
LEFT JOIN ".TABLE_PREFIX."language AS language
ON (language.languageid = " . (!empty($languageid) ? $languageid : "IF(user.languageid = 0, " . intval($vbulletin->options['languageid']) . ", user.languageid)") . ")
WHERE user.userid = $userid
");
$tmp = unserialize($user["phrasegroup_siteteam"]);
$vbphrase = array_merge($vbphrase, $tmp);

require_once('includes/functions_user.php');
require_once('includes/functions_bigthree.php');

$limit = $vbulletin->options['siteteam_count'];
$teamarray = $vbulletin->db->query_read("
SELECT *
FROM ".TABLE_PREFIX."user
JOIN ".TABLE_PREFIX."usergroup AS ugroup
ON ugroup.usergroupid=".TABLE_PREFIX."user.usergroupid
LEFT JOIN ".TABLE_PREFIX."usergroup
ON (FIND_IN_SET(".TABLE_PREFIX."usergroup.usergroupid, ".TABLE_PREFIX."user.membergroupids))
WHERE ugroup.siteteam=1 OR ".TABLE_PREFIX."usergroup.siteteam=1
GROUP BY ".TABLE_PREFIX."user.userid
ORDER BY RAND()
LIMIT $limit
");
while ($team = $vbulletin->db->fetch_array($teamarray)){
if($vbulletin->options['siteteam_type']== 1) {
$avatarurl = fetch_avatar_url($team['userid']);
if (!$avatarurl) {
$teamavatar = 'images/misc/noavatar.gif';
} else {
$teamavatar = $vbulletin->options['bburl'] . '/' . $avatarurl[0];
}
} else {
$teamavatar = '';
$teamuserinfo = verify_id('user', $team['userid'], 1, 1, 47);
$showprofilepic = ($vbulletin->options['profilepicenabled'] AND
$teamuserinfo['profilepic'] AND
($permissions['genericpermissions'] &
$vbulletin->bf_ugp_genericpermissions['canseeprofilepic'] OR
$vbulletin->userinfo['userid'] == $teamuserinfo['userid'])) ? true : false;
if($vbulletin->options['usefileavatar']) {
$teamavatar = $vbulletin->options['profilepicurl'] . '/profilepic' . $teamuserinfo['userid'] . '_' . $teamuserinfo['profilepicrevision'] . '.gif';
} else {
$teamavatar = 'image.php?' . $vbulletin->session->vars['sessionurl'] . 'u=' . $teamuserinfo['userid'] . "&dateline=$teamuserinfo[profilepicdateline]&type=profile";
}

if(empty($teamavatar) || !$showprofilepic) {
$avatarurl = fetch_avatar_url($team['userid']);
if(!$avatarurl) {
$teamavatar = 'images/misc/noavatar.gif';
} else {
$teamavatar = $vbulletin->options['bburl'] . '/' . $avatarurl[0];
}
}
}
$userinfo = verify_id('user', $team['userid'], 1, 1);
$userinfo['lastactivitydate'] = vbdate($vbulletin->options['dateformat'], $userinfo['lastactivity'], true);
$userinfo['lastactivitytime'] = vbdate($vbulletin->options['timeformat'], $userinfo['lastactivity']);
$useronline = fetch_online_status($userinfo, true);
$userinfo['onlinestatuskey'] = $userinfo['onlinestatus'];
$totalcount ++;
eval('$teambits .= "' . fetch_template('siteteam_teambits') . '";');
}
unset($teamarray);

eval('$meetteams .= "' . fetch_template('siteteam_main') . '";');

$footer = '<br />'.$meetteams.$footer;
}

Abe1
18 Mar 2008, 13:17
This is my error:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /index.php(537) : eval()'d code on line 119

I've found the plug-in causing the error. I opened it saw an array and did as instructed above, but still received the same error.

Can anyone help me with this please?

Here is the code within the plug-in:
if($vbulletin->options['siteteam_active'] == 1) {
$userid = $vbulletin->userinfo['userid'];
$languageid = $vbulletin->userinfo['languageid'];
$user = $vbulletin->db->query_first_slave("
SELECT language.phrasegroup_siteteam AS phrasegroup_siteteam
FROM ".TABLE_PREFIX."user AS user
LEFT JOIN ".TABLE_PREFIX."language AS language
ON (language.languageid = " . (!empty($languageid) ? $languageid : "IF(user.languageid = 0, " . intval($vbulletin->options['languageid']) . ", user.languageid)") . ")
WHERE user.userid = $userid
");
$tmp = unserialize($user["phrasegroup_siteteam"]);
$vbphrase = array_merge($vbphrase, $tmp);

require_once('includes/functions_user.php');
require_once('includes/functions_bigthree.php');

$limit = $vbulletin->options['siteteam_count'];
$teamarray = $vbulletin->db->query_read("
SELECT *
FROM ".TABLE_PREFIX."user
JOIN ".TABLE_PREFIX."usergroup AS ugroup
ON ugroup.usergroupid=".TABLE_PREFIX."user.usergroupid
LEFT JOIN ".TABLE_PREFIX."usergroup
ON (FIND_IN_SET(".TABLE_PREFIX."usergroup.usergroupid, ".TABLE_PREFIX."user.membergroupids))
WHERE ugroup.siteteam=1 OR ".TABLE_PREFIX."usergroup.siteteam=1
GROUP BY ".TABLE_PREFIX."user.userid
ORDER BY RAND()
LIMIT $limit
");
while ($team = $vbulletin->db->fetch_array($teamarray)){
if($vbulletin->options['siteteam_type']== 1) {
$avatarurl = fetch_avatar_url($team['userid']);
if (!$avatarurl) {
$teamavatar = 'images/misc/noavatar.gif';
} else {
$teamavatar = $vbulletin->options['bburl'] . '/' . $avatarurl[0];
}
} else {
$teamavatar = '';
$teamuserinfo = verify_id('user', $team['userid'], 1, 1, 47);
$showprofilepic = ($vbulletin->options['profilepicenabled'] AND
$teamuserinfo['profilepic'] AND
($permissions['genericpermissions'] &
$vbulletin->bf_ugp_genericpermissions['canseeprofilepic'] OR
$vbulletin->userinfo['userid'] == $teamuserinfo['userid'])) ? true : false;
if($vbulletin->options['usefileavatar']) {
$teamavatar = $vbulletin->options['profilepicurl'] . '/profilepic' . $teamuserinfo['userid'] . '_' . $teamuserinfo['profilepicrevision'] . '.gif';
} else {
$teamavatar = 'image.php?' . $vbulletin->session->vars['sessionurl'] . 'u=' . $teamuserinfo['userid'] . "&amp;dateline=$teamuserinfo[profilepicdateline]&amp;type=profile";
}

if(empty($teamavatar) || !$showprofilepic) {
$avatarurl = fetch_avatar_url($team['userid']);
if(!$avatarurl) {
$teamavatar = 'images/misc/noavatar.gif';
} else {
$teamavatar = $vbulletin->options['bburl'] . '/' . $avatarurl[0];
}
}
}
$userinfo = verify_id('user', $team['userid'], 1, 1);
$userinfo['lastactivitydate'] = vbdate($vbulletin->options['dateformat'], $userinfo['lastactivity'], true);
$userinfo['lastactivitytime'] = vbdate($vbulletin->options['timeformat'], $userinfo['lastactivity']);
$useronline = fetch_online_status($userinfo, true);
$userinfo['onlinestatuskey'] = $userinfo['onlinestatus'];
$totalcount ++;
eval('$teambits .= "' . fetch_template('siteteam_teambits') . '";');
}
unset($teamarray);

eval('$meetteams .= "' . fetch_template('siteteam_main') . '";');

$footer = '<br />'.$meetteams.$footer;
}
Try changing this:
$tmp = unserialize($user["phrasegroup_siteteam"]);
to this:
$tmp[] = unserialize($user["phrasegroup_siteteam"]);

You have to feed it an array in order for you not to get an error.

dancue
19 Mar 2008, 02:14
That worked Abe, Thanks!!

dave9720
22 Mar 2008, 10:26
Abe1 Can you help me with my problem?
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1259) : eval()'d code on line 5

Plugin Code;
if($vbulletin->options['siteteam_active'] == 1) {
$userid = $vbulletin->userinfo['userid'];
$languageid = $vbulletin->userinfo['languageid'];
$user = $vbulletin->db->query_first_slave("
SELECT language.phrasegroup_siteteam AS phrasegroup_siteteam
FROM ".TABLE_PREFIX."user AS user
LEFT JOIN ".TABLE_PREFIX."language AS language
ON (language.languageid = " . (!empty($languageid) ? $languageid : "IF(user.languageid = 0, " . intval($vbulletin->options['languageid']) . ", user.languageid)") . ")
WHERE user.userid = $userid
");
$tmp[] = unserialize($user["phrasegroup_siteteam"]);
$vbphrase = array_merge($vbphrase, $tmp);

require_once('includes/functions_user.php');
require_once('includes/functions_bigthree.php');

$limit = $vbulletin->options['siteteam_count'];
$teamarray = $vbulletin->db->query_read("
SELECT *
FROM ".TABLE_PREFIX."user
JOIN ".TABLE_PREFIX."usergroup AS ugroup
ON ugroup.usergroupid=".TABLE_PREFIX."user.usergroupid
LEFT JOIN ".TABLE_PREFIX."usergroup
ON (FIND_IN_SET(".TABLE_PREFIX."usergroup.usergroupid, ".TABLE_PREFIX."user.membergroupids))
WHERE ugroup.siteteam=1 OR ".TABLE_PREFIX."usergroup.siteteam=1
GROUP BY ".TABLE_PREFIX."user.userid
ORDER BY RAND()
LIMIT $limit
");
while ($team = $vbulletin->db->fetch_array($teamarray)){
if($vbulletin->options['siteteam_type']== 1) {
$avatarurl = fetch_avatar_url($team['userid']);
if (!$avatarurl) {
$teamavatar = 'images/misc/noavatar.gif';
} else {
$teamavatar = $vbulletin->options['bburl'] . '/' . $avatarurl[0];
}
} else {
$teamavatar = '';
$teamuserinfo = verify_id('user', $team['userid'], 1, 1, 47);
$showprofilepic = ($vbulletin->options['profilepicenabled'] AND
$teamuserinfo['profilepic'] AND
($permissions['genericpermissions'] &
$vbulletin->bf_ugp_genericpermissions['canseeprofilepic'] OR
$vbulletin->userinfo['userid'] == $teamuserinfo['userid'])) ? true : false;
if($vbulletin->options['usefileavatar']) {
$teamavatar = $vbulletin->options['profilepicurl'] . '/profilepic' . $teamuserinfo['userid'] . '_' . $teamuserinfo['profilepicrevision'] . '.gif';
} else {
$teamavatar = 'image.php?' . $vbulletin->session->vars['sessionurl'] . 'u=' . $teamuserinfo['userid'] . "&amp;dateline=$teamuserinfo[profilepicdateline]&amp;type=profile";
}

if(empty($teamavatar) || !$showprofilepic) {
$avatarurl = fetch_avatar_url($team['userid']);
if(!$avatarurl) {
$teamavatar = 'images/misc/noavatar.gif';
} else {
$teamavatar = $vbulletin->options['bburl'] . '/' . $avatarurl[0];
}
}
}
$userinfo = verify_id('user', $team['userid'], 1, 1);
$userinfo['lastactivitydate'] = vbdate($vbulletin->options['dateformat'], $userinfo['lastactivity'], true);
$userinfo['lastactivitytime'] = vbdate($vbulletin->options['timeformat'], $userinfo['lastactivity']);
$useronline = fetch_online_status($userinfo, true);
$userinfo['onlinestatuskey'] = $userinfo['onlinestatus'];
$totalcount ++;
eval('$teambits .= "' . fetch_template('siteteam_teambits') . '";');
}
unset($teamarray);

eval('$meetteams .= "' . fetch_template('siteteam_main') . '";');

$footer = '<br />'.$meetteams.$footer;
}

--------------- Added 1206188832 at 1206188832 ---------------

Never Mind Abe1, Found the problem in vbshout.

ronnie2112
02 Apr 2008, 18:42
I am still getting this error:


Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1259) : eval()'d code on line 5


Im confused as to how to fix it. I tried doing this below but it did not work:

Try changing this in the plugin named "Show Meet our team at forum home page":

$tmp = unserialize($user["phrasegroup_siteteam"]);

To this:

$tmp[] = unserialize($user["phrasegroup_siteteam"]);


I know that the error began and is caused by the plugin called "Site Team Version 1.1.0 for VB version 3.6.8

Where or what do I look for to edit and in which files to fix this error or stop it from being thrown. The Plugin actually functions, I just get the error code seen at the top of the forum page. If I turn off the SiteTeam plugin or make it in-active then the error goes away. It also started giving me that error right after I installed the plugin "SiteTeam v1.1.0" so I am certain that this is where the problem lies correct?

So what exactly do I edit to fix this? Im very confused.

Thank you!

Alfa1
03 Apr 2008, 00:36
I am getting this error:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /index.php(539) : eval()'d code on line 264

Line 264 in index.php is:
{

Line 263 to 271 are:
if ($values1[0] != $values2[0])
{
return ($values1[0] < $values2[0]) ? -1 : 1;
}
else
{
// Same day events. Check the event start time to order them properly (compare number of seconds from 00:00)
return ($values1[1] < $values2[1]) ? -1 : 1;
}

Does anyone have a clue what I can do to resolve this error?

Opserty
03 Apr 2008, 10:28
index.php(539)

Your error is the code evaluated on line 539. That will tell you what Hook Location it is. then you need to go to the Plugin Manager and find a Plugin with this Hook Location. Goto to line 264 of the Plugin and your error should be present. (If you have more then one Plugin at that hook disable them and enable them one by one to find out which of them is causing the error, (n.b. the line number of the eval()'d code may change at this point).

Alfa1
03 Apr 2008, 21:33
Many thanks. Your help showed me the plugin that caused this: "Just join us" in Forumhome (http://www.vbulletin.org/forum/showthread.php?t=168748) affected the hook location forumhome_complete.

How do I find line 264 of the plugin?

here is the content of the plugin:
if($vbulletin->options['justjoin_active'] == 1) {
$userid = $vbulletin->userinfo['userid'];
$languageid = $vbulletin->userinfo['languageid'];
$user = $vbulletin->db->query_first_slave("
SELECT language.phrasegroup_justjoin AS phrasegroup_justjoin
FROM ".TABLE_PREFIX."user AS user
LEFT JOIN ".TABLE_PREFIX."language AS language
ON (language.languageid = " . (!empty($languageid) ? $languageid : "IF(user.languageid = 0, " . intval($vbulletin->options['languageid']) . ", user.languageid)") . ")
WHERE user.userid = $userid
");
$tmp = unserialize($user["phrasegroup_justjoin"]);
$vbphrase = array_merge((array)$vbphrase, $tmp);

require_once('includes/functions_user.php');
require_once('includes/functions_bigthree.php');

$limit = $vbulletin->options['justjoin_count'];
$joinus = $vbulletin->db->query_read("
SELECT *
FROM ".TABLE_PREFIX."user
WHERE usergroupid=2
ORDER BY joindate DESC
LIMIT $limit
");
while ($team = $vbulletin->db->fetch_array($joinus)){
$avatarurl = fetch_avatar_url($team['userid']);
if (!$avatarurl) {
$teamavatar = 'images/misc/noavatar.gif';
} else {
$teamavatar = $vbulletin->options['bburl'] . '/' . $avatarurl[0];
}
$userinfo = verify_id('user', $team['userid'], 1, 1);
$userinfo['lastactivitydate'] = vbdate($vbulletin->options['dateformat'], $userinfo['lastactivity'], true);
$userinfo['lastactivitytime'] = vbdate($vbulletin->options['timeformat'], $userinfo['lastactivity']);
$useronline = fetch_online_status($userinfo, true);
$userinfo['onlinestatuskey'] = $userinfo['onlinestatus'];
$totalcount ++;
eval('$justjoinbits .= "' . fetch_template('justjoin_joinbits') . '";');
}
unset($teamarray);
eval('$justjoin .= "' . fetch_template('justjoin_main') . '";');
$footer = '<br />'.$justjoin.$footer;
}

I assume it is due to this line:
$vbphrase = array_merge($vbphrase, $tmp);
How can I fix this?

xgc ottomatic
15 Apr 2008, 05:37
Thanks Brad the post helped me fix the problem.
My issue was in the
vBShout [Template Cache]
for anyone else that has that plugin

fyi: my error was
array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1259) : eval()'d code on line 5

jeddah_eyes
18 Apr 2008, 19:30
Warning: array_merge() [function.array-merge (http://dm3ty.net/vb/function.array-merge)]: Argument #1 is not an array in [path]/includes/functions.php(1333) : eval()'d code on line 3


what i can do ?

Rocc
19 Apr 2008, 06:53
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1259) : eval()'d code on line 5

I get that on profiles, and when i check line 5 of Functions.php
And its just
"|| # ---------------------------------------------------------------- # ||"
So, what am i supposed to do?

--------------- Added 1208584604 at 1208584604 ---------------

Thanks Brad the post helped me fix the problem.
My issue was in the
vBShout [Template Cache]
for anyone else that has that plugin

fyi: my error was
array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1259) : eval()'d code on line 5
Thanks dude, helped me!

gbox master
29 Apr 2008, 00:19
lucky me i am not the only noob with this problem :D

does anybody knows what i can do with this error

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /index.php(537) : eval()'d code on line 23

i see that you guys have #1 but i have #2
so shoot me i dont know what this meens
give me a hammer and i will build you a house ;)
but php is not my thing :D

kafi
29 May 2008, 11:56
Thank you for this thread, it helped me so much:

originally I have got erorr on member.php

I found that the error was here:

fetch_userinfo plugin vBShout [Template Cache]

original
if (VB_AREA == "Forum")
{
global $globaltemplates;

$globaltemplates = array_merge($globaltemplates, array('forumhome_vbshout'));
}

changed to

if (VB_AREA == "Forum")
{
global $globaltemplates;

$globaltemplates = array_merge((array)$globaltemplates, array('forumhome_vbshout'));
}

Everything works fine now .-)

Rocc
24 Jun 2008, 23:09
Fatal error: Call to a member function query_write() on a non-object in /home/iwarezne/public_html/forums/includes/functions.php(1385) : eval()'d code on line 13
Anyone know howto fix it/

basskiller
29 Jul 2008, 16:25
Thank you for this thread, it helped me so much:

originally I have got erorr on member.php

I found that the error was here:

fetch_userinfo plugin vBShout [Template Cache]

original
if (VB_AREA == "Forum")
{
global $globaltemplates;

$globaltemplates = array_merge($globaltemplates, array('forumhome_vbshout'));
}

changed to

if (VB_AREA == "Forum")
{
global $globaltemplates;

$globaltemplates = array_merge((array)$globaltemplates, array('forumhome_vbshout'));
}

Everything works fine now .-)

thanks.. this fixed mine as well

danward
05 Oct 2008, 15:17
Really helpful thread big thanks! :):up:

McCarron
17 Nov 2008, 21:53
thanks.. this fixed mine as well

This also fixed mine, thanks much!

daz1967
11 Feb 2009, 21:55
If you're having problems finding the code throwing the error you probably shouldn't be poking around in the files in the first place. At the very least you shouldn't be acting all high and mighty and calling my thread "shit".

Try asking nicely for help, and add a please, and include full error messages and I'll try to help you.

Yes I'm an ass hole, but only when provoked. I'm pretty friendly if you come at me with respect.



You have an error in one of your plug-ins at the hook located at line 1259 of /includes/functions.php.

Open functions.php and locate that line, on it you'll find a line of code similar to this one:

($hook = vBulletinHook::fetch_hook('hook_name')) ? eval($hook) : false;

In the above example "hook_name" is the name of the hook location we need to find.

Once you have the name of the hook location go into the plug-in manager in the admincp and find all plug-ins using that location. The code throwing the error is located in one of them.

Thank you Brad, the info you posted help me sort a problem I had put up with for a while

casper04
24 Mar 2009, 12:49
When i restore my database, I got this problem:
I cannot login the Admincp and it informed
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1259) : eval()'d code on line 3
My VB is 3.6.8
Can you help me?

shiola
17 Jan 2010, 17:32
I've got this error since my server got upgraded to PHP5.

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/includes/functions.php(1385) : eval()'d code on line 3

I've read through all these answers but still have no idea what I need to fix or how to fix it. Line 3 of functions.php is || ####

I've searched functions.php for hook locations but there's quite a few, so how do I know which one is the error?

I've stuck (array) into every occurance of array_merge on functions.php but this did nothing.

Any ideas?

shiola
21 Jan 2010, 00:16
bump

matrex722
05 Mar 2010, 21:49
please help me

one user cant open his pm and user cp

it get http 500 internal server error

but all members is ok and it works with theme

this is the error i got :

PHP Fatal error: Unsupported operand types in /home/xxxxxx/public_html/vb/includes/functions_user.php on line 263, referer:

help