vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Cannot use a scalar value as an array (https://vborg.vbsupport.ru/showthread.php?t=327383)

z3r0 07-16-2019 01:16 PM

Cannot use a scalar value as an array
 
Since updating one of my forums to vb3.8.11 I've been receiving the following error in my logs.

Code:

PHP Warning:  Cannot use a scalar value as an array in C:\root\Forums\mysite\search.php on line 2523
Any ideas on what the cause could be?

In Omnibus 07-16-2019 02:08 PM

My best guess is you have an undefined variable in a modification.

Are you using a custom search mod or tool?

You should define the variable.

$var = array();

z3r0 07-16-2019 03:41 PM

Quote:

Originally Posted by In Omnibus (Post 2599862)
My best guess is you have an undefined variable in a modification.

Are you using a custom search mod or tool?

I'm not using any search mods.

Quote:

You should define the variable.

$var = array();
Where would I do that?

Thanks

snakes1100 07-16-2019 06:03 PM

Id suggest looking for any old plugins you had installed prior to the upgrade, example is sphinx search plugin for vb 3.x.x & remove them.

z3r0 07-18-2019 05:05 AM

I've looked through all the plugins and can't find any that interact with search, I'll keep digging around and try and find what action causes the errors.

snakes1100 07-18-2019 07:30 AM

Code:

// cannot view / search this forum, or does not have forum password
                        unset($tmp["$forumid"]);
                }
                else if (!($fperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) AND ($search['showposts'] OR ($display['options']['action'] != 'getnew' AND $display['options']['action'] != 'getdaily' AND !$search['titleonly'])))
                {
                        unset($tmp["$forumid"]);
                }
                else
                {
                        if ($vbulletin->userinfo['userid'])
                        {
                                $lastread["$forumid"] = max($forum['forumread'], (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)));
Line 2523                        }
                        else
                        {
                                $forumview = intval(fetch_bbarray_cookie('forum_view', $forumid));

                                //use which one produces the highest value, most likely cookie
                                $lastread["$forumid"] = ($forumview > $vbulletin->userinfo['lastvisit'] ? $forumview : $vbulletin->userinfo['lastvisit']);
                        }


Id chk forums with passwds, make sure its not +++++ing about a forum with a old passwd & a char it has in it.

Any getdaily or getnew code/hacks you installed

etc etc

z3r0 07-18-2019 12:12 PM

No forums with passwords and I've just checked all plugins for getdaily & getnew but didn't turn anything up.

The error only seems to happen a couple of times a day but when it does I get 15-25 errors in less than a second, I'd checked crons but nothing matches the times and I've clicked just about everywhere I can on the site that triggers a search, but nothing has started it.

The error really isn't a problem, I just like having clean log files so I'll keep plugging away at finding the cause.

In Omnibus 07-18-2019 02:41 PM

Quote:

Originally Posted by z3r0 (Post 2599879)
No forums with passwords and I've just checked all plugins for getdaily & getnew but didn't turn anything up.

The error only seems to happen a couple of times a day but when it does I get 15-25 errors in less than a second, I'd checked crons but nothing matches the times and I've clicked just about everywhere I can on the site that triggers a search, but nothing has started it.

The error really isn't a problem, I just like having clean log files so I'll keep plugging away at finding the cause.

Your PHP error log should tell you the script causing the error if you have the errors set to verbose output.

If you open the file in a text editor what is the content of line 2523 per the error you originally posted?

C:\root\Forums\mysite\search.php on line 2523


All times are GMT. The time now is 02:32 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.01025 seconds
  • Memory Usage 1,732KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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