Our site's server was recently upgraded to PHP 7.2.14. Drupal version: 7.63. Content Access version: 7.x-1.2-beta2
When modifying access permissions, receive this php warning:
Warning: count(): Parameter must be an array or an object that implements Countable in content_access_page() (line 55 of /[docroot]/sites/all/modules/content_access/content_access.admin.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | php72-countable-3026681-7.patch | 741 bytes | cafuego |
| #5 | count_php_7_2-3026681-5.patch | 754 bytes | amsteri |
| #4 | local_history.patch | 1015 bytes | tarik.cipix |
Comments
Comment #2
memcinto commentedMaybe a patch something like this? (Starting at around line 50 of content_access.admin.inc)
Comment #3
salvisPlease check the -dev version first and provide a patch against that if needed.
Comment #4
tarik.cipix commentedHere is a patch
Comment #5
amsteri commentedComment #6
tarik.cipix commentedAmsteri,
You're calling the function twice, I fixed it below, also added a question. Not sure about the else contents.
Comment #7
cafuego commentedRather than try to shoe-horn the return value to be countable and then produce a boolean for the #access value, you can check if the returned settings array is empty or not and everything should work as intended without code warnings.
Array empty => #access FALSE => reset button disabled.
Comment #8
salvisYes, empty() covers all relevant cases.
Comment #9
joelpittetThat looks like the correct solution for this!
Comment #10
Anonymous (not verified) commentedpatch #7 worked for me in php 7.3
Comment #12
gisleFixed in 7.1-1.x-dev.