August 13, 2013 at 8:44 am #56069
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?
FrankAugust 13, 2013 at 12:04 pm #56120
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.
August 13, 2013 at 12:20 pm #56126
Dorian Speed (mentioned on the original bug report) has confirmed it works for her.
I’ve submitted a patch for Genesis, so it should be included in 2.0.1 or 2.1, whichever comes first.
August 13, 2013 at 1:31 pm #56138
anitacParticipantPost count: 6087October 30, 2013 at 11:31 am #69930
worldviewprParticipantPost count: 42
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.October 30, 2013 at 6:43 pm #70027
The topic ‘Genesis 2.0.0 / The Event Calendar problem’ is closed to new replies.