Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #31  
Old 01-21-2015, 02:12 AM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #32  
Old 01-21-2015, 11:26 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #33  
Old 01-21-2015, 12:07 PM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code I posted is straight off my vb4.2.2. PL 1 installation.
Reply With Quote
  #34  
Old 01-21-2015, 02:15 PM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #35  
Old 01-21-2015, 07:37 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by squidsk View Post
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.
Reply With Quote
Благодарность от:
ozzy47
  #36  
Old 01-22-2015, 12:45 AM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'];
Reply With Quote
  #37  
Old 01-22-2015, 11:27 AM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you submit your issue to the bugtracker yet nerbert?
Reply With Quote
  #38  
Old 01-22-2015, 02:54 PM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by final kaoss View Post
Did you submit your issue to the bugtracker yet nerbert?
http://tracker.vbulletin.com/browse/VBIV-16061
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:02 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.04123 seconds
  • Memory Usage 2,245KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete