PDA

View Full Version : Error message after using advanced editor


MistViper
01-24-2015, 10:10 PM
Hey guys, I'm curious as to how to fix this error I've been getting. I noticed that after I went to advanced editor, to test a new BB code I added to strikethrough words or phrases, it had this error. I know it wasn't caused by the BB code I added, because I removed it and I still received the error. Any ideas on how to find out the problem?

ozzy47
01-24-2015, 10:12 PM
Disable plugins via the includes/config.php file.

To do that open your includes/config.php file and below <?php add the following.

define('DISABLE_HOOKS', true);

So it looks like this:
<?php
define('DISABLE_HOOKS', true);
/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 4.2.2

Use a editor like notepad++ (http://notepad-plus-plus.org/download/v6.6.8.html) to edit any files, don't use Notepad or Wordpad.

If that fixes the issue enable plugins again by adding // before the line you added, then navigate to ACP --> Plugins & Products --> Manage Products and disable one mod at a time until you find the one causing the issue.

Once you find the culprit, post in that mods thread what the issue is, and maybe someone in that thread can help. :)

Lynne
01-24-2015, 10:14 PM
What version of vBulletin are you running and what version of PHP is on the server?

nerbert
01-24-2015, 10:39 PM
Here's the offending code :


if (!$vbulletin->GPC['advanced'])
{
if ($vbulletin->GPC_exists['emailupdate'])
{
$edit['emailupdate'] =& $vbulletin->GPC['emailupdate'];
}
else
{
$edit['emailupdate'] = array_pop($array = array_keys(fetch_emailchecked($threadinfo)));
}
if ($vbulletin->GPC_exists['htmlstate'] AND $foruminfo['allowhtml'])
{
$edit['htmlstate'] = array_pop($array = array_keys(fetch_htmlchecked($vbulletin->GPC['htmlstate'])));
}
}


It looks obvious to me that you should simply edit out "$array = ". Tried that but it didn't get rid of the warning. Does anyone know what the problem is with that line?

MistViper
01-24-2015, 10:46 PM
What version of vBulletin are you running and what version of PHP is on the server?

4.2.2 and php is 5.3

nerbert
01-24-2015, 11:01 PM
I think I got it.

editpost.php lines 315 to 328


if (!$vbulletin->GPC['advanced'])
{
if ($vbulletin->GPC_exists['emailupdate'])
{
$edit['emailupdate'] =& $vbulletin->GPC['emailupdate'];
}
else
{
$array = array_keys(fetch_emailchecked($threadinfo)); $edit['emailupdate'] = array_pop($array);
}
if ($vbulletin->GPC_exists['htmlstate'] AND $foruminfo['allowhtml'])
{
$array = array_keys(fetch_htmlchecked($vbulletin->GPC['htmlstate'])); $edit['htmlstate'] = array_pop($array);
}
}


This preserves the original line numbers. Anyone want to confirm this?

Lynne
01-25-2015, 02:57 AM
Did you already add the below line to your config.php file?

***
As of vBulletin 4.2.2, notices and warnings are no longer suppressed by default like in previous versions of the software. This means that on some servers, you may see warnings that you never saw before. In order to stop them from showing, please add the following line to your config.php file under the <?php line:


define('SKIP_DS_ERRORS', true);

***

nerbert
01-25-2015, 11:12 AM
As of vBulletin 4.2.2, notices and warnings are no longer suppressed by default like in previous versions of the software. This means that on some servers, you may see warnings that you never saw before. ......

I'm going to be upgrading to 4.2.3 soon and I want all errors, warnings, and notices enabled AND I want to fix any code that generates them. If I understand this correctly this line you recommend adding to config.php isn't missing in 4.2.2, it must be added because full error/warning in enabled elsewhere. Am I right? If so where is it enabled? Is it at the top of each file or is there some global setting that enables it?

The reason I want to do this is I want all these warnings enabled for developing addons. I remember not long ago in an earlier version all error reporting was suppressed and debugging was ridiculously difficult for new addons.

ozzy47
01-25-2015, 11:17 AM
I think in includes/class_core.php in the function vb_error_handler

nerbert
01-25-2015, 11:59 AM
That seems to affect what text is shown but it doesn't seem to affect whether error/warning text is shown.

Lynne
01-25-2015, 05:18 PM
I'm going to be upgrading to 4.2.3 soon and I want all errors, warnings, and notices enabled AND I want to fix any code that generates them.
If you upgrade to 4.2.3, the warnings will be suppressed again.

nerbert
01-25-2015, 05:21 PM
If you upgrade to 4.2.3, the warnings will be suppressed again.

But is it just the lines in config.php that do it or is there some other setting somewhere else?

Lynne
01-25-2015, 05:40 PM
Paul would be able to answer that question since he was the one who upgraded the software.

squidsk
01-26-2015, 07:13 PM
Here's the offending code :


if (!$vbulletin->GPC['advanced'])
{
if ($vbulletin->GPC_exists['emailupdate'])
{
$edit['emailupdate'] =& $vbulletin->GPC['emailupdate'];
}
else
{
$edit['emailupdate'] = array_pop($array = array_keys(fetch_emailchecked($threadinfo)));
}
if ($vbulletin->GPC_exists['htmlstate'] AND $foruminfo['allowhtml'])
{
$edit['htmlstate'] = array_pop($array = array_keys(fetch_htmlchecked($vbulletin->GPC['htmlstate'])));
}
}


It looks obvious to me that you should simply edit out "$array = ". Tried that but it didn't get rid of the warning. Does anyone know what the problem is with that line?

You need to pull out the $array = . . . onto its own line and then pass $array into the function that will clear the error.

Note: You'll have to do that for the if statement as well. This is a php conflict with vb, not sure if that one is on the list of conflicts fixed in 4.2.3 or not.


if (!$vbulletin->GPC['advanced'])
{
if ($vbulletin->GPC_exists['emailupdate'])
{
$edit['emailupdate'] =& $vbulletin->GPC['emailupdate'];
}
else
{
$array = array_keys(fetch_emailchecked($threadinfo));
$edit['emailupdate'] = array_pop($array);
}
if ($vbulletin->GPC_exists['htmlstate'] AND $foruminfo['allowhtml'])
{
$edit['htmlstate'] = array_pop($array = array_keys(fetch_htmlchecked($vbulletin->GPC['htmlstate'])));
}
}

nerbert
01-26-2015, 09:10 PM
See Post #6. I did the same thing but kept both statements on the same line to preserve the original line numbering. Same goes for the contents of the next conditional.

squidsk
01-26-2015, 09:41 PM
See Post #6. I did the same thing but kept both statements on the same line to preserve the original line numbering. Same goes for the contents of the next conditional.
Goes to show that eyes see what they want and not what's really there.