PDA

View Full Version : 4.2.2 Upgraders, Check your Advanced Search


findingpeace
10-15-2013, 12:39 PM
Yesterday, we upgraded from 4.2.1 to 4.2.2 - we did this after extensive testing in a separate environment, to get all of our other plugins playing nice. The upgrade went smoothly, and we love the new version! Much faster on PHP 5.4, so we're really happy about that.

One quick thing I wanted to share, unrelated to plugins. Click the "Advanced Search" button on your site. (http://www.yoursite.com/search.php). Do you have errors at the top of the page?

I did, and it frustrated me because we had carefully followed all upgrade steps. It persisted, even with hooks off.

The solution? See below:

http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/4000233-warning-declaration-of-vbforum_item_socialgroupmessage?p=4000793#post4000 793

1. - edit the files "socialgroupmessage.php" and "socialgroupdiscussion.php" found in "packages/vbforum/item/"

2. - The original function reads:

protected function getLoadQuery($required_query, $force_rebuild = false)

3. - Change the function to this:

protected function getLoadQuery($required_query = self::QUERY_BASIC, $force_rebuild = false)

I personally much prefer this method, since I don't think turning off error messages is a very good way of dealing with errors. Just wanted to share, in case anyone saw the same issue!

Paul M
10-15-2013, 12:44 PM
This was something that didnt show up in our testing, nor was it reported by any alpha or beta testers. However, it is an issue, and you have posted the correct fix.

findingpeace
10-15-2013, 12:52 PM
Cool :) Just wanted to make sure I was sharing accurate information for other OCD upgraders like me!

Great job on the release, Paul (and everyone on the vB team) - our server load is way down, and a lot of memory is freed up too.

meaters
10-15-2013, 06:39 PM
Thanks. Fixed!

I agree with the above comment about speed, pages load noticeable faster on our forums too.

Amaury
10-16-2013, 05:47 AM
Yeah, noticed this Sunday night after upgrading early Sunday morning (like, 12:50 AM - 2:00 AM early). I just have to wait for our technical administrator to get on again to fix it.

We had one on profiles, but that was due to DragonByte Tech's Username Change modification, which was fixed for 4.2.2 on Wednesday -- we just needed to update it.

pityocamptes
11-25-2013, 06:32 PM
Yesterday, we upgraded from 4.2.1 to 4.2.2 - we did this after extensive testing in a separate environment, to get all of our other plugins playing nice. The upgrade went smoothly, and we love the new version! Much faster on PHP 5.4, so we're really happy about that.

One quick thing I wanted to share, unrelated to plugins. Click the "Advanced Search" button on your site. (http://www.yoursite.com/search.php). Do you have errors at the top of the page?

I did, and it frustrated me because we had carefully followed all upgrade steps. It persisted, even with hooks off.

The solution? See below:

http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/4000233-warning-declaration-of-vbforum_item_socialgroupmessage?p=4000793#post4000 793

1. - edit the files "socialgroupmessage.php" and "socialgroupdiscussion.php" found in "packages/vbforum/item/"

2. - The original function reads:

protected function getLoadQuery($required_query, $force_rebuild = false)

3. - Change the function to this:

protected function getLoadQuery($required_query = self::QUERY_BASIC, $force_rebuild = false)

I personally much prefer this method, since I don't think turning off error messages is a very good way of dealing with errors. Just wanted to share, in case anyone saw the same issue!



Will have to check this out. I had some errors in my admincp and on the Articles tab, and was told on here to turn off errors. Will check the search function, after turning on errors.

This is on my CMS page at top:

Warning: Declaration of vBCms_Item_Content::setItemId() should be compatible with that of vB_Model::setItemId() in ..../packages/vbcms/item/content.php on line 26

These are 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


Was told by Ozzy that these were php 5.4 errors. Did you have the same ones, and if so, how did you fix them - besides turning off errors? Thanks.

ForceHSS
11-25-2013, 07:07 PM
Will have to check this out. I had some errors in my admincp and on the Articles tab, and was told on here to turn off errors. Will check the search function, after turning on errors.

This is on my CMS page at top:

Warning: Declaration of vBCms_Item_Content::setItemId() should be compatible with that of vB_Model::setItemId() in ..../packages/vbcms/item/content.php on line 26

These are 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


Was told by Ozzy that these were php 5.4 errors. Did you have the same ones, and if so, how did you fix them - besides turning off errors? Thanks.

They are only warnings not errors

pityocamptes
11-25-2013, 07:22 PM
They are only warnings not errors

Oh, ok. Since I'm curious, warnings for what, and how do they get fixed? Will a newer php server version solve this? If it is a php warning, which version should be running for 4.2.2? Thanks.

ForceHSS
11-25-2013, 09:02 PM
http://www.vbulletin.com/forum/forum/vbulletin-announcements/vbulletin-announcements_aa/4000121-vbulletin-4-2-2-full-has-been-released
https://vborg.vbsupport.ru/showthread.php?t=304936&highlight=vB_Database_Alter_MySQL%3A%3Aquery
http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/415784-vbulletin-4-2-0-xampp-install-error

pityocamptes
11-26-2013, 03:38 AM
Ok, thanks. I thought OP had the same problem as me. Looks like my host may be having issues, contacted them. Thanks again.

Old-Git
03-25-2014, 06:12 PM
Just upgrade to 4.2.2 Pl1 and found this bug almost immediately. Fortunately a quick search turned up this fix. However, given that this has been around since last October shouldn't this already be in the relevant PHP files for the latest updates?

quincyy
11-25-2014, 11:27 PM
Just upgrade to 4.2.2 Pl1 and found this bug almost immediately. Fortunately a quick search turned up this fix. However, given that this has been around since last October shouldn't this already be in the relevant PHP files for the latest updates?

My thoughts exactly. But the fix worked after updating the 2 files.

ForceHSS
11-26-2014, 09:01 AM
My thoughts exactly. But the fix worked after updating the 2 files.
This fix is already in 4.2.3

TransAmDan
12-25-2014, 07:26 PM
So this bug/fix was October 2013 and was apparent in 4.2.2 PL1.
I'm running 4.2.2 PL3 and seen this error pop up in a few places, so why has VBulletin not got a patch for this after soo long. I guess the upgrades fix many issues, but I do find every upgrade I'm chasing fixing of bugs from that upgrade. Thanks for posting the fix.
This forum is very handy for fixing things and great mods too.

Paul M
12-25-2014, 10:44 PM
I'm running 4.2.2 PL3 and seen this error pop up in a few places, so why has VBulletin not got a patch for this after soo long.
Bugs dont generally get patched (unless they are very serious) they get fixed in the next version, and as already stated above, its fixed in 4.2.3

Krazeguy
01-19-2015, 10:28 PM
Yesterday, we upgraded from 4.2.1 to 4.2.2 - we did this after extensive testing in a separate environment, to get all of our other plugins playing nice. The upgrade went smoothly, and we love the new version! Much faster on PHP 5.4, so we're really happy about that.

One quick thing I wanted to share, unrelated to plugins. Click the "Advanced Search" button on your site. (http://www.yoursite.com/search.php). Do you have errors at the top of the page?

I did, and it frustrated me because we had carefully followed all upgrade steps. It persisted, even with hooks off.

The solution? See below:

http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/4000233-warning-declaration-of-vbforum_item_socialgroupmessage?p=4000793#post4000 793

1. - edit the files "socialgroupmessage.php" and "socialgroupdiscussion.php" found in "packages/vbforum/item/"

2. - The original function reads:

protected function getLoadQuery($required_query, $force_rebuild = false)

3. - Change the function to this:

protected function getLoadQuery($required_query = self::QUERY_BASIC, $force_rebuild = false)

I personally much prefer this method, since I don't think turning off error messages is a very good way of dealing with errors. Just wanted to share, in case anyone saw the same issue!

Thanks for the fix!

ozzy47
01-19-2015, 10:39 PM
Just a FYI, this is fixed in 4.2.3

Brandon Sheley
01-20-2015, 12:17 AM
Thanks for the heads up OP and fix. I just upgraded a site to the latest version in the members area, which is 4.2.2 PL4.
It sure would be nice if it was fixed in the download package..

nerbert
01-20-2015, 12:55 AM
As long as we're talking errors, here's one I fixed today for Who's Online

in includes/functions_online.php , line 516, find


else if ($userinfo['values']['do'] == 'editfolders' OR $userinfo['action']['do'] == 'updatefolders')


and change it to


else if ($userinfo['values']['do'] == 'editfolders' OR $userinfo['values']['do'] == 'updatefolders')


I didn't research this or test it but it's so obvious it has to be correct. But if I'm wrong, so what? It doesn't throw an error message. I looked at what I have left of an old vB 4.0.5 dev site and it was the same then and that was downloaded over 2 years ago. It's probably been that way for ages. Couldn't they have fixed this instead of hiding error/warning messages????

--------------- Added 1421724977 at 1421724977 ---------------


..........

These are 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

..............



Under what circumstances do these warnings occur? Anyone know? I'm almost certain I know what the problem is but I would want to be able to test it

Paul M
01-20-2015, 06:13 PM
It sure would be nice if it was fixed in the download package..
As has been repeated several times now, it is fixed, in 4.2.3.

Paul M
01-20-2015, 06:18 PM
I didn't research this or test it .....
Clearly not, since it was fixed in 4.2.2.

nerbert
01-20-2015, 07:32 PM
Clearly not, since it was fixed in 4.2.2.

I'm running 4.2.2 and it's been throwing warnings all the time in Who's Online. There's still another occasional warning associated with another line of code that I'm not sure how to fix.



/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 4.2.2 Patch Level 1 - Licence Number XXXXXXXXXXX
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000-2014 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| ################################################## ################## ||
\*================================================ ======================*/


/*================================================= =====================*\
|| ################################################## ##################
|| # Downloaded: 18:15, Sat Aug 2nd 2014
|| # CVS: $RCSfile$ - $Revision: 61394 $
|| ################################################## ##################
\*================================================ ======================*/


I edited it because it was throwing warnings.

ozzy47
01-20-2015, 08:17 PM
Well, you should be running 4.2.2 pl4 as you are running a outdated version with known security issues. :)

nerbert
01-20-2015, 09:01 PM
Well, you should be running 4.2.2 pl4 as you are running a outdated version with known security issues. :)

My other admin will have time for an upgrade this weekend. Meanwhile I modified the modcp directory name.

squidsk
01-20-2015, 09:35 PM
Clearly not, since it was fixed in 4.2.2.
Sorry that code is not fixed in 4.2.2PL1, 4.2.2PL2 or 4.2.2PL4, I haven't checked 4.2.2PL3 but I'd be surprised if it was fixed there.

The code on line 516 of includes/functions_online.php is:
else if ($userinfo['values']['do'] == 'editfolders' OR $userinfo['action']['do'] == 'updatefolders')

instead of:
else if ($userinfo['values']['do'] == 'editfolders' OR $userinfo['values']['do'] == 'updatefolders')

Now it isn't a game breaking bug, as the only consequence of that typo is that if a user is updating their folder there won't be a corresponding specific action entry and the user will get the generic 'private_messaging' entry, but it should still be fixed given the actual fix required.

Paul M
01-20-2015, 10:28 PM
Hmmm, well my test forum is supposedly running 4.2.2, and its fixed :confused:

I also know its fixed in core, as I remember doing it. I guess I'll have to look at SVN later.

Paul M
01-20-2015, 11:15 PM
Ah well, I found it ;
http://tracker.vbulletin.com/browse/VBIV-15962

Apparently I fixed it last summer, so its in 4.2.3, not 4.2.2

My apologies, I guess I must have tested it locally and never reverted the change.

ForceHSS
01-20-2015, 11:19 PM
in 4.2.3 it is
else if ($userinfo['values']['do'] == 'editfolders' OR $userinfo['values']['do'] == 'updatefolders')line 518

ozzy47
01-20-2015, 11:27 PM
in 4.2.3 it is
else if ($userinfo['values']['do'] == 'editfolders' OR $userinfo['values']['do'] == 'updatefolders')line 518

Which would be the correct fix. :)

ForceHSS
01-21-2015, 12:04 AM
Which would be the correct fix. :)
Reason why I posted was showing it was there

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


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



and on line 518


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
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
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:
function add_index($fieldname, $fields, $type, $overwrite)

Line 518:
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
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 1421897642 at 1421897642 ---------------

UPDATE: I think the following edits resolve the problem:

line 159, includes/blog_functions_online.php


//$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


//$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
Did you submit your issue to the bugtracker yet nerbert?

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