Image upload causes site error

Created on 5 December 2023, 12 months ago
Updated 6 December 2023, 12 months ago

Problem/Motivation

Under Drupal 10
When adding an image for the background the site has an error.
The logs show the following issue

[05-Dec-2023 15:12:15 Europe/London] Uncaught PHP Exception Error: "Call to undefined function Drupal\gravitas_countdown\Plugin\Block\file_create_url()" at /modules/contrib/gravitas_countdown/src/Plugin/Block/GravitasCountdownBlock.php line 275

on further investigation the function $banner_url = file_create_url($banner_url); # file_create_url is depreciated

Steps to reproduce

upload an image

Proposed resolution

substitute line 275 withe $banner_url = \Drupal::service('file_url_generator')->generateAbsoluteString($banner_url);

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

1.1

Component

Code

Created by

🇬🇧United Kingdom HNS-IT-Solutions

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024