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.
As per documentation here module_load_include, module_load_include shouldn't be loaded in global context since it requires Drupal to be fully bootstrapped. The attached patch replaces usage of module_load_include with require_once.
Comment | File | Size | Author |
---|---|---|---|
workflow_replace_module_load_include-D7.patch | 4.46 KB | Sagar Ramgade | |
Comments
Comment #2
johnvSome questions:
- did you encounter an error somewhere?
- in workflow_node/workflownode.module , other code standard is used in comparison with other files.
- also, sometimes __DIR__ is used, sometimes __FILE__
I am hesitating to implement this, if this is not fixing something broken.
Comment #3
Sagar Ramgade CreditAttribution: Sagar Ramgade as a volunteer and commentedHi John,
I didn't encounter any errors however i found it should not be called it global context as Drupal needs to be fully bootstrapped in order to use that. If you see the core modules of Drupal it doesn't use module_load_include in global context for e.g field.module.
For the second point I had used __DIR__ because workflow_node includes workflow.node.type_map.inc, workflow.deprecated.inc which are not part of workflow_node directory instead they are part of workflow directory.
Above all reasons compare the load times, i remember in one of projects we used module_load_include and site started working slow.
Comment #5
johnvI didn't find any problems either.
Comment #6
johnv