Fix deprecated code report issues for 9.3.x

Created on 19 April 2022, over 2 years ago
Updated 30 January 2023, almost 2 years ago

Problem/Motivation

I got a Call to deprecated functions drupal_get_path() and file_create_url() running drupal-check.

 ------ -----------------------------------------------------------------------------
  Line   adminimal_theme.theme
 ------ -----------------------------------------------------------------------------
  45     Call to deprecated function drupal_get_path():
         in drupal:9.3.0 and is removed from drupal:10.0.0. Use
           \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.
  48     Call to deprecated function file_create_url():
         in drupal:9.3.0 and is removed from drupal:10.0.0.
           Use the appropriate method on \Drupal\Core\File\FileUrlGeneratorInterface
           instead.
  49     Call to deprecated function file_create_url():
         in drupal:9.3.0 and is removed from drupal:10.0.0.
           Use the appropriate method on \Drupal\Core\File\FileUrlGeneratorInterface
           instead.
 ------ -----------------------------------------------------------------------------

Steps to reproduce

$> drupal-check web/themes/contrib/adminimal_theme
 ------ -----------------------------------------------------------------------------
  Line   adminimal_theme.theme
 ------ -----------------------------------------------------------------------------
  45     Call to deprecated function drupal_get_path():
         in drupal:9.3.0 and is removed from drupal:10.0.0. Use
           \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.
  48     Call to deprecated function file_create_url():
         in drupal:9.3.0 and is removed from drupal:10.0.0.
           Use the appropriate method on \Drupal\Core\File\FileUrlGeneratorInterface
           instead.
  49     Call to deprecated function file_create_url():
         in drupal:9.3.0 and is removed from drupal:10.0.0.
           Use the appropriate method on \Drupal\Core\File\FileUrlGeneratorInterface
           instead.
 ------ -----------------------------------------------------------------------------

Proposed resolution

Fixes for:

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡΅πŸ‡ΉPortugal fcertal

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024