Announcement

Collapse
No announcement yet.

Warning: Invalid argument supplied for foreach() in [path]/index.php on line 147

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • nzjo
    replied
    Thanks so much for the patch Sidney

    I did it - and it wasn't hard - your instructions were excellent

    Leave a comment:


  • nzjo
    replied
    Thanks heaps for that Sidney

    I'm going to try and do what you said to fix it - hope I don't muck it up

    Leave a comment:


  • sidney
    replied
    I've entered this as a bug report and attached a patch at http://www.vbulletin.com/forum/proje...?issueid=27026

    Leave a comment:


  • sidney
    replied
    I've tracked this down to a bug in VBulletin and I have a fix for it. However, I can't see how Agg could have seen it in Australia. My analysis of the bug says that it should only happen when your local time zone is more than 12 hours ahead of GMT, which for all practical purposes means in NZ during Daylight Savings Time (GMT+13) and only between midnight and 1am local time. So either I am slightly off on the analysis, or somebody tried to fix it and was partially successful between the 3.7.3pl1 that Agg was running and the 3.7.4pl1 that I just upgraded to from 3.6 at midnight and so saw the bug.

    Or maybe, Agg, did you happen to be in New Zealand when you tested it or for some reason have your user profile options set to NZ time?

    First, the simplest fix, which will eliminate the error message but will not display birthdays during the hour that the bug is being triggered. In the switch statement in index.php just before the line 145 that is mentioned in the error, add a default clause that initializes $birthdayarray to an empty array. The problem is that the code is assuming that today is either what is called day1 (the date at GMT-12) or day2 (the date at GMT+12). But for one hour after midnight in NZ in our summer it is neither of those, it is one day later.
    Code:
    switch ($today)
        {
            case $birthdaystore['day1']:
                $birthdaysarray = $birthdaystore['users1'];
                break;
    
            case $birthdaystore['day2']:
                $birthdaysarray = $birthdaystore['users2'];
                break;
    
            default:
                $birthdaysarray = array();
        }
    The fix of the root cause is in includes/functions_databuild.php in the function build_birthdays(). There you will find several places where the code says
    Code:
    TIMENOW + (-12 - $serveroffset) * 3600
    and
    Code:
    TIMENOW + (12 - $serveroffset) * 3600
    , which is used to find what date it is in the earliest time zone GMT-12 and the latest time zone GMT+12 to see which two days to check for birthdays. The problem is that there are actually 26 hours span of time zones in the world so two days are strictly speaking not enough. However there is no permanent habitation in either GMT-12 nor GMT+14, and only 600 people who are at GMT+13.75 in their summer, so we can get away with using a span of GMT-11 to GMT+13.

    So the fix is to change each -12 is the above code to instead say -11 and change each 12 to say 13.
    Code:
    TIMENOW + (-11 - $serveroffset) * 3600
    and
    Code:
    TIMENOW + (13 - $serveroffset) * 3600
    That should allow birthdays to work for users in New Zealand. The addition of the default line in the switch statement in index.php will prevent any error message even for a user in the Chatham Islands in their summer between 1am and 1:45am, when they will not see birthdays.

    Leave a comment:


  • nzjo
    replied
    oh cool - thanks - and what about the users with the bogus entries? - most of mine just have no birthdate at all - would those users all get deleted then? - or will it give them some birthday date?

    Leave a comment:


  • Jtague
    replied
    Go to:

    Admincp --> scroll down to --> Maintenance --> Execute SQL Query

    Copy the query to the Manual Query box and click continue

    This assumes you have access to run queries.

    Leave a comment:


  • nzjo
    replied
    Hey I might try this - where do you stick the query?

    Originally posted by RCK View Post
    I think you can simply use this request to remove all the bogus birthday entries
    Code:
    UPDATE user SET birthday = '' WHERE birthday < '01-01-1903' AND birthday <> ''
    Cheers

    Leave a comment:


  • Lats
    replied
    Originally posted by Agg View Post
    Ok, I just searched for users with the "Birthday Before" search field set to 1903-01-01 .. to find everyone with a birthday of 1902 or earlier. It returned 77,000+ users.. we only have about 100k users, so this is obviously a bogus result.
    That result would also include users who didn't set their birth date. (0000-00-00)

    You would also need to add Birthday is after: 1903-01-01 in your query.

    Leave a comment:


  • nzjo
    replied
    bummer - looks like there is no easy solution that sucks

    Leave a comment:


  • RCK
    replied
    I think you can simply use this request to remove all the bogus birthday entries
    Code:
    UPDATE user SET birthday = '' WHERE birthday < '01-01-1903' AND birthday <> ''
    Cheers

    Leave a comment:


  • Agg
    replied
    Originally posted by Wayne Luke View Post
    If you imported from another software package, the result is probably not bogus.
    I didn't import from another software package. We started from scratch with vBulletin back in 2001 and did not import our previous forum info. Can you check if you can reproduce the bogus results? That would let us know if it's a vBulletin issue or something specific to our system.

    Originally posted by Wayne Luke View Post
    You should set an announcement/notice to have everyone update their birthday so it is correct. There are probably not too many 106 year old or older people on your forums.
    But if any of the people with bogus birthdates are not active users anymore or choose to ignore the notice, we will still get the error message. It also doesn't explain why we can't search for these users.

    Originally posted by Wayne Luke View Post
    Alternatively, you can wipe everyone's birthday.

    update user set birthday = '';
    Thanks for the suggestion, but this is another workaround, not a solution. I'm not going to wipe info for 100,000 users to prevent the display of an error message. Is there no way vBulletin can be updated to handle this condition more elegantly than a big error message at the top of the page? Surely this counts as a bug?

    Leave a comment:


  • Wayne Luke
    replied
    If you imported from another software package, the result is probably not bogus.

    You should set an announcement/notice to have everyone update their birthday so it is correct. There are probably not too many 106 year old or older people on your forums.

    Alternatively, you can wipe everyone's birthday.

    update user set birthday = '';

    Leave a comment:


  • Agg
    replied
    Originally posted by Wayne Luke View Post
    The original problem in the thread is that a user with that specific date for a birthday has their birthyear set to before 1902. vBulletin doesn't support dates before 1902. Change the birthdate to occur after 1902 and the error will go away.
    Ok, I just searched for users with the "Birthday Before" search field set to 1903-01-01 .. to find everyone with a birthday of 1902 or earlier. It returned 77,000+ users.. we only have about 100k users, so this is obviously a bogus result. So it seems the statement "vBulletin doesn't support dates before 1902" applies to this kind of search also, which is going to make it impossible to find the problem person and change their birthday to a valid one.

    Leave a comment:


  • Wayne Luke
    replied
    Originally posted by LoMaker View Post
    My problem:
    This is caused by a plugin. You will have to investigate your plugins and ask the author for help.

    --------------------
    The original problem in the thread is that a user with that specific date for a birthday has their birthyear set to before 1902. vBulletin doesn't support dates before 1902. Change the birthdate to occur after 1902 and the error will go away.

    Leave a comment:


  • LoMaker
    replied
    My problem:
    Warning: in_array() [function.in-array]: Wrong datatype for second argument in [path]/index.php(565) : eval()'d code on line 155

    Leave a comment:

widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X