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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sagar Ramgade created an issue. See original summary.

johnv’s picture

Status: Needs review » Needs work

Some 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.

Sagar Ramgade’s picture

Hi 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.

  • johnv committed 53e38dc on 7.x-2.x authored by Sagar Ramgade
    Issue #2828392 by Sagar Ramgade: Remove usages of module_load_include in...
johnv’s picture

I didn't find any problems either.

johnv’s picture

Version: 7.x-2.x-dev » 7.x-2.9
Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.