Commit dba61c45 authored by webchick's avatar webchick

#599122 follow-up by scor and catch: Do not use module_load_include() in global context.

parent f58a4c72
......@@ -245,7 +245,9 @@ function module_load_install($module) {
* module_load_include('inc', 'node', 'content_types');
* @endcode
*
* Do not use this function to load an install file. Use module_load_install()
* Do not use this function to load an install file, use module_load_install()
* instead. 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.
*
* @param $type
......
......@@ -10,12 +10,12 @@
* mechanism for auto-loading core APIs, so we have to load them on
* every page request.
*/
module_load_include('inc', 'field', 'field.crud');
module_load_include('inc', 'field', 'field.default');
module_load_include('inc', 'field', 'field.info');
module_load_include('inc', 'field', 'field.multilingual');
module_load_include('inc', 'field', 'field.attach');
module_load_include('inc', 'field', 'field.form');
require_once DRUPAL_ROOT . '/modules/field/field.crud.inc';
require_once DRUPAL_ROOT . '/modules/field/field.default.inc';
require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
require_once DRUPAL_ROOT . '/modules/field/field.multilingual.inc';
require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
require_once DRUPAL_ROOT . '/modules/field/field.form.inc';
/**
* @defgroup field Field API
......
......@@ -14,9 +14,9 @@
* test helper functions
*/
module_load_include('inc', 'field_test', 'field_test.entity');
module_load_include('inc', 'field_test', 'field_test.field');
module_load_include('inc', 'field_test', 'field_test.storage');
require_once DRUPAL_ROOT . '/modules/field/tests/field_test.entity.inc';
require_once DRUPAL_ROOT . '/modules/field/tests/field_test.field.inc';
require_once DRUPAL_ROOT . '/modules/field/tests/field_test.storage.inc';
/**
* Implements hook_permission().
......
......@@ -6,6 +6,9 @@
* Defines a "managed_file" Form API field and a "file" field for Field module.
*/
// Load all Field module hooks for File.
require_once DRUPAL_ROOT . '/modules/file/file.field.inc';
/**
* Implements hook_help().
*/
......@@ -28,9 +31,6 @@ function file_help($path, $arg) {
}
}
// Load all Field module hooks for File.
module_load_include('inc', 'file', 'file.field');
/**
* Implements hook_menu().
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment