vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Error message after using advanced editor (https://vborg.vbsupport.ru/showthread.php?t=316903)

MistViper 01-24-2015 10:10 PM

Error message after using advanced editor
 
1 Attachment(s)
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.

PHP Code:

define('DISABLE_HOOKS'true); 

So it looks like this:
PHP Code:

<?php
define
('DISABLE_HOOKS'true);
/*=================================================  =====================*\
|| ##################################################  ################## ||
|| # vBulletin 4.2.2

Use a editor like notepad++ 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 :

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

Quote:

Originally Posted by Lynne (Post 2534401)
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

Code:

                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:

PHP Code:

define('SKIP_DS_ERRORS'true); 

***

nerbert 01-25-2015 11:12 AM

Quote:

Originally Posted by Lynne (Post 2534422)
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

Quote:

Originally Posted by nerbert (Post 2534450)
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

Quote:

Originally Posted by Lynne (Post 2534523)
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

Quote:

Originally Posted by nerbert (Post 2534404)
Here's the offending code :

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.

Code:

                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

Quote:

Originally Posted by nerbert (Post 2534726)
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.


All times are GMT. The time now is 07:14 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01218 seconds
  • Memory Usage 1,771KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (3)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete