|
@@ -152,8 +152,8 @@ |
|
|
block discarded – undo |
|
152
|
152
|
&& $entity->hasField($image_field) |
|
153
|
153
|
) { |
|
154
|
154
|
$id = $entity->get($unsplash_field)->value; |
|
155
|
|
- $raw_image = file_get_contents('unsplash://' . $id); |
|
156
|
|
- $filename = $id . '.jpg'; |
|
|
155
|
+ $raw_image = file_get_contents('unsplash://'.$id); |
|
|
156
|
+ $filename = $id.'.jpg'; |
|
157
|
157
|
$file = file_save_data($raw_image, "public://images/$filename", FILE_EXISTS_REPLACE); |
|
158
|
158
|
$entity->$image_field->setValue(['target_id' => $file->id()]); |
|
159
|
159
|
} |
Please login to merge, or discard this patch.