I'm seeing this error in my logs:
TypeError: Argument 1 passed to Drupal\filecache\Cache\FileSystemBackend::prepareItem() must be an instance of stdClass, bool given, called in /home/pieter/v/joinup-dev/web/modules/contrib/filecache/src/Cache/FileSystemBackend.php on line 245 in /home/pieter/v/joinup-dev/web/modules/contrib/filecache/src/Cache/FileSystemBackend.php on line 361 [ae3d22e0-6f94-46de-b587-25500d6c89c7] #0 /home/pieter/v/joinup-dev/web/modules/contrib/filecache/src/Cache/FileSystemBackend.php(245): Drupal\filecache\Cache\FileSystemBackend->prepareItem(false, true)
It turns out to be caused by a README.md
file being present in my filecache folder that explains the reason for these cache files to be present in the repository.
The bug is in FileSystemBackend::get()
, in this snippet:
if ($item = $this->getFile($filename)) {
$item = $this->prepareItem($item, $allow_invalid);
// ...
}
The call to $this->getFile()
might return FALSE
if the file cannot be deserialized, or NULL
if the file does not exist. We should check the value passing it to the $this->prepareItem()
call.
Comment | File | Size | Author |
---|---|---|---|
#2 | 3082271-2.patch | 1 KB | pfrenssen |
|
Comments
Comment #2
pfrenssenComment #4
pfrenssen