vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   4.2.2 Upgraders, Check your Advanced Search (https://vborg.vbsupport.ru/showthread.php?t=303430)

nerbert 01-21-2015 02:12 AM

Has anyone seen these warnings in admincp?

Warning: Declaration of vB_Database_Alter_MySQL::add_index() should be compatible with that of vB_Database_Alter::add_index() in ..../includes/class_dbalter.php on line 882

Warning: Declaration of vB_Database_Alter_MySQL::add_field() should be compatible with that of vB_Database_Alter::add_field() in ..../includes/class_dbalter.php on line 882

Warning: Declaration of vB_Database_Alter_MySQL::drop_field() should be compatible with that of vB_Database_Alter::drop_field() in ..../includes/class_dbalter.php on line 882

Warning: Declaration of vB_Database_Alter_MySQL::query() should be compatible with that of vB_Database_Alter::query() in ..../includes/class_dbalter.php on line 882

I searched for the generic warning language and at stackoverflow various posters said when one class extends another the methods' arguments must match exactly, including defaults. So for example on line 242 we have

Code:

        function add_index($fieldname, $fields, $type, $overwrite) {}

and on line 518

Code:

        function add_index($fieldname, $fields, $type = '', $overwrite = false)
        {
                $this->init_table_info();
          . . . . . . . . . .


It looks like all you'd have to do is edit in the defaults in the first method, and likewise for the other incompatibilities in the warnings.

But I would want to test this before recommending it here, after all, this stuff alters database structure. So when do these warnings happen?

Paul M 01-21-2015 11:26 AM

They were all dealt with in 4.2.2

http://tracker.vbulletin.com/browse/VBIV-15611
http://tracker.vbulletin.com/browse/VBIV-15612
http://tracker.vbulletin.com/browse/VBIV-15613
http://tracker.vbulletin.com/browse/VBIV-15614

nerbert 01-21-2015 12:07 PM

The code I posted is straight off my vb4.2.2. PL 1 installation.

squidsk 01-21-2015 02:15 PM

There appears to have been a partial reversal of the fix. All the parameters are now specified, but the default values are not (this is in 4.2.2PL4) which is what the warnings are complaining about.

e.g.

Line 242:
Code:

function add_index($fieldname, $fields, $type, $overwrite)
Line 518:
Code:

function add_index($fieldname, $fields, $type = '', $overwrite = false)
Notice the default values for $type and $overwrite.

The functions add_index, add_field, drop_field and query all have a default value missing in their declarations in the base class.

Paul M 01-21-2015 07:37 PM

Quote:

Originally Posted by squidsk (Post 2533775)
There appears to have been a partial reversal of the fix. All the parameters are now specified, but the default values are not (this is in 4.2.2PL4) which is what the warnings are complaining about.

As far as I can tell, nothing got reversed, those are the fixes as applied at the time.
Curiously, I cannot get those errors to show up on my php 5.4 install at all, not sure why.
Its also quite odd that no one has ever reported them either (other than the comment in this thread).

Regardless, it does look like they need more changes to be fully correct, which have now been applied in 4.2.3.

nerbert 01-22-2015 12:45 AM

I found an obscure one for you, Paul M. This is an illegal string offset warning in Who's Online that I'm sure occurs only if you have the Blog product. The warnings arise from $wol_user["$seeuserid"]['username'] and $wol_user["$seeuserid"]['musername']. I print_r()'d $wol_user and some of its elements were simple usernames, others were arrays of username and musername. Apparently the simple username values come from a blog plugin in hook location "online_ids_titles" (includes/functions_online.php, line 2499), which calls function blog_online_ids_titles() in includes/blog_functions_online.php, line 82. The problem seems to come at line 159. I think the code there should be similar to the code at lines 2494 and 2495 in includes/functions_online.php

--------------- Added [DATE]1421897642[/DATE] at [TIME]1421897642[/TIME] ---------------

UPDATE: I think the following edits resolve the problem:

line 159, includes/blog_functions_online.php

Code:

//$wol_user["$userresult[userid]"] = $userresult['musername'];
$wol_user["$userresult[userid]"]['musername'] = $userresult['musername'];
$wol_user["$userresult[userid]"]['username'] = $userresult['username'];


line 414 (as numbered after the first edit), includes/blog_functions_online.php

Code:

//$blogtitle = $wol_bloguser["$userid"]['title'] ? $wol_bloguser["$userid"]['title'] : $wol_user["$userid"];
$blogtitle = $wol_bloguser["$userid"]['title'] ? $wol_bloguser["$userid"]['title'] : $wol_user["$userid"]['username'];


final kaoss 01-22-2015 11:27 AM

Did you submit your issue to the bugtracker yet nerbert?

nerbert 01-22-2015 02:54 PM

Quote:

Originally Posted by final kaoss (Post 2533917)
Did you submit your issue to the bugtracker yet nerbert?

http://tracker.vbulletin.com/browse/VBIV-16061


All times are GMT. The time now is 03:22 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.01120 seconds
  • Memory Usage 1,744KB
  • 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
  • (6)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete