WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
Warning: in_array...post-template.php on line 1039 (10 posts)

  1. yvanox
    Member
    Posted 1 year ago #

    In my calendar page, when a month is empty (no events) I have multiple lines with "Warning: in_array() expects parameter 2 to be array, null given in /home/content/08/10163108/html/wp-includes/post-template.php on line 1039"
    over my menu bar. If I go to a month with some events and I refresh the window, the error messages disapear... WP 3.5 twenty ten tks

    http://wordpress.org/extend/plugins/the-events-calendar/

  2. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Hey yvanox. Thanks for the note here, and sorry for the inconvenience. Any chance you've got a link to your site? I haven't seen this particular issue and would like to check it out in action.

    A couple suggestions right off the bat, though: make sure you're on the latest version of Twenty Ten, and - if you can - toggle over to Twenty Eleven or Twenty Twelve to see if the issue persists there. Similarly, can you confirm that you've updated the plugin to 2.0.11 and find this issue still persists even then?

    Once I hear back from you, I'll do my best to advise further. Cheers and thanks for your patience so far.

  3. BosmaMultimedia
    Member
    Posted 1 year ago #

    I'm getting this error by clicking on a eventcategory where the event is placed:

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /wp-includes/post-template.php on line 1039

    I've found this quote in an other supportforum:
    <blocknote>
    The PHP warning means that $_current_page->ancestors does not have a datatype of 'array.'

    What changes had you recently made to the site right before it broke?
    </blocknote>

    In the other forum... There wasn't a fix.

  4. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Hey BosmaMultimedia: did you get this sorted, or are you still having problems here? If the latter, mind sharing a link to the problematic category here? I'm not seeing this on my end and wanted to check it out in action to identify if it's a bug we need to tackle. Thanks!

  5. majones
    Member
    Posted 1 year ago #

    Hi Roblagatta - I'm picking this up on my site too - definitely only on the pages of months sans events. See May on our events calendar.

  6. jonahcoyote
    Member
    Posted 1 year ago #

    Hi majones,

    We have this fixed in our upcoming 3.0 release but unfortunately until then, there is no other fix that we know of.

    - Jonah

  7. smielock
    Member
    Posted 1 year ago #

    Hi all:

    I posted a fix to this on one of my previous postings. It is a quick fix and does the trick. If you search for my profile name in this support area you may find my posting to this issue. Actually, I found it. Check out this post. Hope it helps.

    [resolved] Calendar Month View Issues (12 posts)

    It was active about 2 weeks ago from the time of this posting.

  8. smielock
    Member
    Posted 1 year ago #

    Here is the gist of what should help you.

    Here is the work around.

    /wp-includes/post-template.php file is the one you will edit.

    Line 1039 of wp-includes/post-template looks like:

    if ( in_array( $page->ID, $_current_page->ancestors ) )

    Recommended change:

    if ( gettype($_current_page->ancestors) === 'array' && in_array( $page->ID, $_current_page->ancestors ) )

    I also recommend you simply rename the original post-template.php file in case this does not work or creates additional problems.

    This will do the trick until the new release comes out.

  9. jonahcoyote
    Member
    Posted 1 year ago #

    Hi smielock,

    Thanks for the work around! Everyone take note though that you are modifying core WordPress files for this fix and if you update WordPress this change will be lost.

    Regards,
    - Jonah

  10. roonexbg
    Member
    Posted 1 year ago #

    My server crashed because this error, I made the turnaround and hope the version 3.0 PRO will be released soon.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.