Closed ConcreteOwl closed 6 years ago
This code also 'fixes' this issue
if (!is_array($users) || count($users) == 0) {
See #1971
Thanks Michele, I knew there must be a better way of fixing this..
David: your solution fixed this specific problem, and it's correct. BTW with my approach we are sure to not break code in other points where PHP tries to count the result of the getAccessEntityUsers method.
Ah Yes, I understand.. Thank You
The following warning is displayed when a user attempts to edit a block. Warning: count(): Parameter must be an array or an object that implements Countable in /xxxx/xxxx/concrete/core/models/permission/access/entity/types/page_owner.php on line 24
Line 24
if (count($users) == 0) {
I have 'fixed' this with this code
Line 24
if (count((array)$users) == 0) {
Although this has stopped the PHP warnings, I am not sure if this is the correct way?