Skip to content
Snippets Groups Projects
Commit a4a238b0 authored by Nicholas Stees's avatar Nicholas Stees Committed by Jeffrey Fortune
Browse files

Fix: Deprecated function: Return type of...

parent e45492ca
No related branches found
No related tags found
1 merge request!3Fix: Deprecated function: Return type of...
name: Background Image Field name: Background Image Field
description: Allows you to add responsive background images based on selctors. description: Allows you to add responsive background images based on selctors.
core: 8.x core: 8.x
core_version_requirement: ^8 || ^9 core_version_requirement: ^8 || ^9 || ^10
type: module type: module
package: Field types package: Field types
......
{
"name": "drupal/bg_img_field",
"description": "Allows you to add responsive background images based on selectors.",
"type": "drupal-module",
"license": "GPL-2.0-or-later",
"require": {
"drupal/core": "^8 || ^9 || ^10"
}
}
\ No newline at end of file
...@@ -36,7 +36,7 @@ class CSSSnippet implements MarkupInterface { ...@@ -36,7 +36,7 @@ class CSSSnippet implements MarkupInterface {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function jsonSerialize() { public function jsonSerialize(): mixed {
return $this->__toString(); return $this->__toString();
} }
......
...@@ -315,7 +315,7 @@ class BgImgFieldFormatter extends ResponsiveImageFormatter implements ContainerF ...@@ -315,7 +315,7 @@ class BgImgFieldFormatter extends ResponsiveImageFormatter implements ContainerF
} }
if ($mapping['image_mapping'] == "_original image_") { if ($mapping['image_mapping'] == "_original image_") {
$url = file_create_url($image->getFileUri()); $url = \Drupal::service('file_url_generator')->generateAbsoluteString($image->getFileUri());
} }
else { else {
$url = ImageStyle::load($mapping['image_mapping'])->buildUrl($image->getFileUri()); $url = ImageStyle::load($mapping['image_mapping'])->buildUrl($image->getFileUri());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment