Genesis 2.0 incompatibility in month view

Home Forums Calendar Products Events Calendar PRO Genesis 2.0 incompatibility in month view

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #59482
    frankomator
    Participant

    After upgrading to Genesis 2.0.0 I’m getting an error message:
    “Warning: in_array() [function.in-array]: Wrong datatype for second argument in (…) /wp-content/themes/genesis/lib/functions/general.php on line 293”

    Additionally, in debug mode:
    Notice: Undefined variable: post_type_names in (…) /wp-content/themes/genesis/lib/functions/general.php on line 273

    Best,
    Frank

    #59852
    Dorian Speed
    Participant

    I’m having the exact same issue, also in month view, after upgrading to Genesis 2.0.

    #59868
    anthonymking
    Participant

    Same issue here.

    #59869
    frankomator
    Participant

    It seems that it doesn’t affect functionality. Until this compatibility issue is (hopefully) solved, you can get rid of the annoying error message in placing the following lines into your wp-config.php:

    @ini_set(‘log_errors’,’On’);
    @ini_set(‘display_errors’,’Off’);
    @ini_set(‘error_reporting’, 4339 ); //only log errors you will want to know about
    define(‘WP_DEBUG’, false);
    define(‘WP_DEBUG_LOG’, false);
    define(‘WP_DEBUG_DISPLAY’, false);

    #59895
    chas offutt
    Participant

    Frank, thank you, but would be able to provide a little more detail where to add the following lines in wp-config.pho?

    #59908
    Ted
    Participant

    Frank,
    I’ve tried to add the code but, it’s not doing anything. Any Suggestions?

    #59913
    frankomator
    Participant

    If you dont’ want to log the errors, this should hide the error messages:
    @ini_set(‘display_errors’,’Off’);
    define(‘WP_DEBUG’, false);
    define(‘WP_DEBUG_DISPLAY’, false);

    @chas: insert it above the line:
    /* That’s all, stop editing! Happy blogging. */

    #59914
    Ted
    Participant

    thanks, had to tinker with the code in my editor but, it’s working now.

    #59924
    chas offutt
    Participant

    Thanks Frank. I tried and didn’t work, but realized I may have a slightly different problem as my error message read:

    Warning: in_array() expects parameter 2 to be array, null given in /home/accokeek/public_html/wp-content/themes/genesis/lib/functions/general.php on line 293

    #59953
    Barry
    Member

    Hi all! we haven’t yet played with Genesis 2.0 but bear us and we’ll look into this – thanks for your patience 🙂

    #59955
    Barry
    Member

    Hi guys, I can’t actually replicate this particular problem so it may be I’m missing a setting or something along those lines.

    What I do notice thought is that the piece of code in question – genesis_has_post_type_archive_support() – is calling another Genesis function called genesis_get_cpt_archive_types_names() and is expecting it to return an array, however it isn’t guaranteed to always do so and that is leading to this error.

    So it may be worth taking that up with StudioPress and seeing if they can shed any light on this. And, of course, if anyone can add some extra detail about how to replicate this we’d definitely be happy to look into it further.

    #59957
    frankomator
    Participant

    Hi Barry,
    I’m using WordPress 3.6, Genesis 2.0.0 with child theme, Events Calendar PRO 3.0.5. The error message appears only in the monthly calendar view (on top of the page). The error is not related to any additional Genesis plug-ins.

    #59959
    Barry
    Member

    Hi Frank, strange as that’s basically what I tested against (albeit my Genesis child theme is devoid of any substantive customizations). I’ll have another play though 🙂

    #60109
    Dorian Speed
    Participant

    I’ve tried deactivating plugins, switching to the basic Genesis child theme, with no success. Strangely, this error is NOT showing up on socalkidssandiego.com, which is having other issues (month-view of calendar is loading slowly, which has already been noted by support). That site has a ton of added functionality – coupons, ads, etc. – and the calendar doesn’t show the error. But on a plain vanilla installation of Genesis 2.0, I get the error message.

    Here is the relevant section of code:

    /**
    * Check if a post type supports an archive setting page.
    *
    * @since 2.0.0
    *
    * @uses genesis_get_global_post_type_name() Get the `post_type` from the global `$post` if supplied value is empty.
    * @uses genesis_get_cpt_archive_types_names() Get list of custom post type names which need an archive settings page.
    *
    * @param string $post_type_name Post type name.
    *
    * @return bool True if custom post type name has support, false otherwise.
    */
    function genesis_has_post_type_archive_support( $post_type_name = ” ) {

    $post_type_name = genesis_get_global_post_type_name( $post_type_name );

    return in_array( $post_type_name, genesis_get_cpt_archive_types_names() ) &&
    post_type_supports( $post_type_name, ‘genesis-cpt-archives-settings’ );

    }

    I don’t know if that helps or not. Sounds like you already haveGenesis 2.0 and have tested it, but just in case someone else might see this and recognize the problem, I am pasting it here.

    #60144
    Barry
    Member

    OK, so I can now replicate this – I’m not really sure we can say this is a bug with The Events Calendar, however.

    What is happening is that Genesis’s code (which you quoted above, Dorian) is calling a function and expecting it to return a type of data called an array – but actually it will not always do so – and that is causing the error.

    So I think it would be worth reporting this to the theme authors to see if there’s anything they can do on their level – I’m sure they could easily ensure that an array, even an empty array, is returned in these circumstances – as I don’t see any particularly easy ways of mitigating this with a snippet that you can drop in to your child theme’s functions.php file or anything like that.

    In summary, at this point I would recommend:

    A) Turning of the display of errors (see Frank’s post or seek help from your web host if necessary as not all environments are the same)

    B) Report this issue to StudioPress and ask if they can patch genesis_get_cpt_archive_types_names() so that it can be relied upon to return an array (right now it may return a null value in situations like this one)

Viewing 15 posts - 1 through 15 (of 20 total)
  • The topic ‘Genesis 2.0 incompatibility in month view’ is closed to new replies.