Problem/Motivation
We would like to deprecate all legacy code in the file core/includes/module.inc. The function module_load_include()
lives in that file.
Proposed resolution
The module_load_include()
function should be deprecated, and its use removed from core.
Remaining tasks
TBD
User interface changes
None
API changes
The function module_load_include()
will be deprecated.
Original report by scor
This is a follow up issue on Drupal 7's #599122: Do not use module_load_include() in global context. This function is misleading and useless in some cases like in an .install file or in "global context" where a native PHP require_once call must be used instead.
The module_load_include()
function provides little or no advantage over calling simpler functions directly. In #599122, several calls to require(DRUPAL_ROOT . 'file')
were changed to use module_load_include()
for consistency. This broke core, so after the changes were reverted, webchick commented in #599122-15:
I guess we should look at removing this stupid, confusing, and useless function in Drupal 8.