Closed (fixed)
Project:
Views Aggregator Plus
Version:
8.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2018 at 16:53 UTC
Updated:
29 Apr 2020 at 22:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tr commentedmodule_load_include () is NOT deprecated yet, because ModuleHandler can't do everything that is currently done by module_load_include(). In fact, module_load_include() is still used more than 50 times throughout core.
So while replacing module_load_include() is something that will need to be done eventually, it absolutely should not be causing a fatal error on your site. That indicates a much bigger problem on your site. module_load_include() is in core/includes/module.inc, and it is loaded in index.php by DrupalKernel - you can't get much more basic than that in Drupal. This function should always be available at all times.
Comment #3
uwe mindrup commentedThank you for your fast response. With an exact local copy of the site (php7.1 copy vs. php5.6 orignal) the function module_load_include() works as expected. Strange.
I try to find out the difference.
Comment #4
mlncn commentedAs the original reporter can't reproduce the error... i think we're good to close this!
Comment #5
attisanas the documentation on https://api.drupal.org/api/drupal/core%21includes%21module.inc/function/... clearly states, this call should be replaced
... Do not use this function in a global context since it requires Drupal to be fully bootstrapped, use require_once DRUPAL_ROOT . '/path/file' instead.
when using drupal from an outside script (bootstrap from script) an Error will be thrown on accessing
module_load_include.tia
Comment #6
tr commented@attisan pointed out an important fact in the documentation. The attached patch uses require_once instead of module_load_include().
In the long run, the functions that are being loaded here should be plugins so we don't have to include them explicitly.
Comment #8
tr commentedCommitted #6.