Back to MyCalendar Support

n.morgana
n.morgana

I'm encountering the following error while creating a new event. It apparently is related to the version 7.2 of PHP.

"count(): Parameter must be an array or an object that implements Countable D:\WAMP\Apache24\htdocs\Projects\project_1\plugins\kurtjensen\mycalendar\formwidgets\rrule\partials_rrule.htm line 24"


Besides all that, thank you for developing this great plug-in!

Last updated

me28365
me28365

Yeah, I'm having the same issue. It is related to PHP 7.2. As of PHP 7.2, you have to guard against the count() function returning null.

Change this: count(array_get($f, 'WBYDAY')) To something like this: array_get($f, 'WBYDAY') === null ? 0 : count(array_get($f, 'WBYDAY'))

Hopefully, this will be fixed because I really want to use this plugin.

BTW, thanks for the plugin.

Also, n.morgana this appears to be a big fundamental change that has affected quite a bit of php source code. If plausible, you could always downgrade to PHP 7.1. That's what I did.

Last updated

KurtJensen
KurtJensen

@me28365 Thanks for providing a hint for solving this issue. I am running PHP 7.0.25 so I did not test on PHP 7.2.

Please update to "1.2.19: Fixes error "count() Parameter must be an array or an object that implements Countable" to get the fix.

There may still be issues due to the included library so if you still run into "count($x)" issues please post back here and consider doing a PR at the recurr library. ( https://github.com/simshaun/recurr/ )

This file for example has multiple uses of "count()":

https://github.com/simshaun/recurr/blob/master/src/Recurr/Transformer/TextTransformer.php

dquiroga
dquiroga

Hi there i've updated to php 7.4 but my system was over 7.1 working with build 419, i did the update of php but forgot to update befere october, now i get the same error, what can i do?

1-4 of 4