It seems to me that imagecache_external_generate_path() either returns a filepath string, or returns a FieldItemList object depending on if the image was called externally or if we have the image already. I think the following code:
if ($needs_refresh === FALSE) {
return $filepath;
}
elseif ($filepath = imagecache_external_fetch($url, $directory . '/' . $filename)) {
return $filepath;
}
should be...
if ($needs_refresh === FALSE) {
return $filepath;
}
elseif ($filepath = imagecache_external_fetch($url, $directory . '/' . $filename)) {
return $filepath->getString();
}
Can you please confirm? I think your module handles it later on, but Im calling this function directly in some custom code and the return is inconsistent.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2973305-4.patch | 1.12 KB | BarisW |
| #2 | 2973305-1.patch | 435 bytes | willeaton |
Comments
Comment #2
willeaton commentedAttaching a patch for this, without this patch, no images are rendered the first time round, only on the second.
Comment #3
willeaton commentedHi, is anyone maintaining this module?
Comment #4
BarisW commentedSorry for the delay in responding. I believe that you're right in that
imagecache_external_generate_path()returns inconsistent data. The reason for this is thatimagecache_external_fetch()returned$file->uriinstead of$file->getFileUri();I changed this, would you be so kind to test this with your custom code and let me know if this fixes your problem?
Comment #5
willeaton commentedOk but it will be a few weeks before I can go back on to that project
Comment #6
achapI had the same issue. Patch #4 fixed it for me.
Comment #7
achapComment #8
BarisW commentedThanks for the review!
Comment #10
BarisW commented