Handle for deprecated function drupal_get_path()

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Node
- drupal_get_path('module', 'node')
+ \Drupal::service('extension.list.module')->getPath('node')

# Node (Alternative)
- drupal_get_path('module', 'node')
+ \Drupal::service('extension.path.resolver')->getPath('module', 'node')

# Theme
- drupal_get_path('theme', 'seven')
+ \Drupal::service('extension.list.theme')->getPath('seven')

# Standard
- drupal_get_path('profile', 'standard')
+ \Drupal::service('extension.list.profile')->getPath('standard')

Handle for deprecated function drupal_get_filename()

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Node
- drupal_get_filename('module', 'node')
+ \Drupal::service('extension.list.module')->getPathname('node')

# Node (alternative)
- drupal_get_filename('module', 'node')
+ \Drupal::service('extension.path.resolver')->getPathname('module', 'node')

# Theme
- drupal_get_filename('theme', 'seven')
+ \Drupal::service('extension.list.theme')->getPathname('seven')

# Standard
- drupal_get_filename('profile', 'standard')
+ \Drupal::service('extension.list.profile')->getPathname('standard')

Reference Material: