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

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

    Haven't changed anything forever on my forum - so not sure why all of a sudden like 2 min ago I started getting an error up the top of my site

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



    Anyone know why that would have come up or how to get rid of it?

    Thanks

  • #2
    crisis averted for a little while - it was when it hit midnight - after I had changed the Daylight savings settings - have gone now and changed it back and the error has gone - but ... how now my times are an hour slow

    Is this a known problem with 3.7.2 Patch Level 1 or something? - or is it something else ... I have used this feature before as we have it every year obviously - never given error messages before

    Got to go to bed now - but will check back to see if anyone knows tommorrow

    Thanks

    Comment


    • #3
      I had the same problem with the same error code appearing on the index page of a forum at the same time as the OP. The solution above didn't work for me, however.

      I had to remove the code around line 147 on index.php, as shown below, before I could get the error message to stop appearing on a forum.

      I'd appreciate it if a solution to the problem could be found that allows the forum to work normally without the need to remove lines of code.

      Thanks.

      Code Removed from index.php

      Code:
      // ### TODAY'S BIRTHDAYS #################################################
      if ($vbulletin->options['showbirthdays'])
      {
          if (!is_array($vbulletin->birthdaycache)
              OR ($today != $vbulletin->birthdaycache['day1'] AND $today != $vbulletin->birthdaycache['day2'])
              OR !is_array($vbulletin->birthdaycache['users1'])
          )
          {
              // Need to update!
              require_once(DIR . '/includes/functions_databuild.php');
              $birthdaystore = build_birthdays();
              DEVDEBUG('Updated Birthdays');
          }
          else
          {
              $birthdaystore = $vbulletin->birthdaycache;
          }
      
          switch ($today)
          {
              case $birthdaystore['day1']:
                  $birthdaysarray = $birthdaystore['users1'];
                  break;
      
              case $birthdaystore['day2']:
                  $birthdaysarray = $birthdaystore['users2'];
                  break;
          }
          // memory saving
          unset($birthdaystore);
      
          $birthdaybits = array();
      
          foreach ($birthdaysarray AS $birthday)
          {
              eval('$birthdaybits[] = "' . fetch_template('forumhome_birthdaybit') . '";');
          }
      
          $birthdays = implode(', ', $birthdaybits);
      
          if ($stylevar['dirmark'])
          {
              $birthdays = str_replace('<!--rlm-->', $stylevar['dirmark'], $birthdays);
          }
      
          $show['birthdays'] = iif ($birthdays, true, false);
      }
      else
      {
          $show['birthdays'] = false;
      }

      Comment


      • #4
        yup, just started getting exactly the same problem here. we changed to daylight savings time early this morning but it's now about 18 hours later and the problem has only just appeared. vbb 3.7.3pl1.

        edit: I seem to have fixed it by turning off the display of birthdays on the forum index. any official word from jelsoft would be good, given this thread is a week old..
        www.overclockers.com.au

        Comment


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

          Comment


          • #6
            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.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API - Full / Mobile
            Vote for your favorite feature requests and the bugs you want to see fixed.

            Comment


            • #7
              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.
              www.overclockers.com.au

              Comment


              • #8
                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 = '';
                Translations provided by Google.

                Wayne Luke
                The Rabid Badger - a vBulletin Cloud demonstration site.
                vBulletin 5 API - Full / Mobile
                Vote for your favorite feature requests and the bugs you want to see fixed.

                Comment


                • #9
                  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?
                  www.overclockers.com.au

                  Comment


                  • #10
                    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

                    Comment


                    • #11
                      bummer - looks like there is no easy solution that sucks

                      Comment


                      • #12
                        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.
                        Lats...

                        Comment


                        • #13
                          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

                          Comment


                          • #14
                            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.

                            Comment


                            • #15
                              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?

                              Comment

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