Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By sun on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
drupal_get_filename()
always returns the relative pathname of the main extension file now — regardless of whether such a file exists.
Drupal 7
$pathname = drupal_get_filename('module', 'node');
var_dump($pathname);
$pathname = drupal_get_filename('theme', 'stark');
var_dump($pathname);
core/modules/node/node.module
core/themes/stark/stark.info
Drupal 8
$pathname = drupal_get_filename('module', 'node');
var_dump($pathname);
$pathname = drupal_get_filename('theme', 'stark');
var_dump($pathname);
core/modules/node/node.module
core/themes/stark/stark.theme
Note
drupal_get_filename()
will most likely be removed prior to the release of Drupal 8.0. It is mostly used internally by Drupal core. If your code relies on it, change it to use the information from respective extension handlers instead; e.g., ModuleHandler::getModuleList()
.
Impacts:
Module developers