When purging if the response from Fastly API is not an array the following error is thrown:
count(): Parameter must be an array or an object that implements Countable Api.php:251 [warning]
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | fastly_wrong_response_type_2978860.patch | 800 bytes | valic |
| #2 | fastly-purge-warnings-2978860-2.patch | 1.12 KB | kasperg |
Comments
Comment #2
kasperg commentedHere is a patch that adds additional type checking for the response. If it is not an array we treat is as an error.
Comment #3
vvuksan-fastly commentedCommited.
Comment #4
vvuksan-fastly commentedComment #5
gg4 commentedThis is highly problematic.
$resultis an object in this case, not an array.This change should be reverted ASAP.
Comment #6
valicWe could add check if is object and then convert it to array (I am using attached patch).
Comment #7
gg4 commented@valic this issue is marked as closed and the change has been reverted. It is probably best to create a new issue explaining the benefits of that approach and the problem it solves.