Using the Event Calendar plugin by Modern Tribe with Genesis 2.0.0 produces an PHP error message in the monthly view of the calendar such as:
“Warning: in_array() [function.in-array]: Wrong datatype for second argument in (…) /wp-content/themes/genesis/lib/functions/general.php on line 293″
The developer is aware of the problem but can't fix it:
"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 (...) 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)"
Any ideas on how to fix this?
In genesis/lib/functions/general.php, line 269, right before the foreach that appears on line 270, add:
$post_type_names = array();
If that works, let me know, and I'll ensure that it makes it into the next release of Genesis, so that your hack is persisted.
Kudos to the Events Calendar dev for tracking this down.
Thanks GaryJ for responding to my tweet. You're the BEST!
Did this change for the better make it to 2.0.1, or will it find its way to 2.1? Thanks for your eagle eye.
The topic ‘Genesis 2.0.0 / The Event Calendar problem’ is closed to new replies.
Subscribe to get early access to new themes, discounts and brief updates about what's new with StudioPress!