Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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:
- drupal_get_path() and drupal_get_filename() have been deprecated in favor of extension listing services https://www.drupal.org/node/2940438
- Functions file_create_url() and file_url_transform_relative() are deprecated https://www.drupal.org/node/2940031
Comment | File | Size | Author |
---|---|---|---|
#3 | 3275977-fix-deprecated-code-report.patch | 1.04 KB | fcertal |
Issue fork adminimal_theme-3275977
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
fcertal CreditAttribution: fcertal as a volunteer commentedComment #3
fcertal CreditAttribution: fcertal as a volunteer commentedComment #4
fcertal CreditAttribution: fcertal as a volunteer and at Devoteam Creative Tech commentedComment #5
fcertal CreditAttribution: fcertal as a volunteer and at Devoteam Creative Tech commentedComment #7
fcertal CreditAttribution: fcertal as a volunteer and at Devoteam Creative Tech commentedComment #9
loopy1492 CreditAttribution: loopy1492 commentedIt looks like this is also being resolved in https://www.drupal.org/project/adminimal_theme/issues/3296538
Comment #10
loopy1492 CreditAttribution: loopy1492 commented