I am upgrading to 9.3.16. The backwards compatibility layer for file_uri() addressed in https://www.drupal.org/project/drupal/issues/3254245 applies only for generateAbsoluteString and generateString.. but does not apply for transformRelative... So I am getting following error message after upgrading to 9.3.16..
TypeError: Argument 1 passed to Drupal\Core\File\FileUrlGenerator::transformRelative() must be of the type string, null given, called in /var/www/docroot/core/includes/file.inc on line 105 in Drupal\Core\File\FileUrlGenerator->transformRelative() (line 208 of core/lib/Drupal/Core/File/FileUrlGenerator.php)
After I patched locally with below fix, its working !
function file_url_transform_relative($file_url) {
@trigger_error('file_url_transform_relative() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\File\FileUrlGenerator::transformRelative() instead. See https://www.drupal.org/node/2940031', E_USER_DEPRECATED);
++ if (is_null($file_url)) {
++ return NULL;
++ }
return \Drupal::service('file_url_generator')->transformRelative($file_url);
}