When using the Managed: Download the images and save its metadata to the database, file handling option.

Sometime i get the following error:

The website encountered an unexpected error. Please try again later.
Recoverable fatal error: Object of class Drupal\Core\Field\FieldItemList could not be converted to string in Drupal\image\Entity\ImageStyle->buildUri() (line 186 of core/modules/image/src/Entity/ImageStyle.php).

Anyone has the same problem ?

Comments

j.b created an issue. See original summary.

j.b’s picture

To solve the problem:

Change line 186 in file imagecache_external.module

From
return $file->uri to return $file->getFileUri();

Apparently $file->uri return an object/array

idebr’s picture

Status: Active » Needs review
StatusFileSize
new1.05 KB

I can confirm the error. The suggested resolution in #2 works as expected.

Attached patch implements the proposed resolution in #2.

swentel’s picture

Status: Needs review » Closed (outdated)

this was fixed somewhere later, so this is fine.