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) { ...@@ -245,7 +245,9 @@ function module_load_install($module) {
* module_load_include('inc', 'node', 'content_types'); * module_load_include('inc', 'node', 'content_types');
* @endcode * @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. * instead.
* *
* @param $type * @param $type
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
* mechanism for auto-loading core APIs, so we have to load them on * mechanism for auto-loading core APIs, so we have to load them on
* every page request. * every page request.
*/ */
module_load_include('inc', 'field', 'field.crud'); require_once DRUPAL_ROOT . '/modules/field/field.crud.inc';
module_load_include('inc', 'field', 'field.default'); require_once DRUPAL_ROOT . '/modules/field/field.default.inc';
module_load_include('inc', 'field', 'field.info'); require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
module_load_include('inc', 'field', 'field.multilingual'); require_once DRUPAL_ROOT . '/modules/field/field.multilingual.inc';
module_load_include('inc', 'field', 'field.attach'); require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
module_load_include('inc', 'field', 'field.form'); require_once DRUPAL_ROOT . '/modules/field/field.form.inc';
/** /**
* @defgroup field Field API * @defgroup field Field API
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
* test helper functions * test helper functions
*/ */
module_load_include('inc', 'field_test', 'field_test.entity'); require_once DRUPAL_ROOT . '/modules/field/tests/field_test.entity.inc';
module_load_include('inc', 'field_test', 'field_test.field'); require_once DRUPAL_ROOT . '/modules/field/tests/field_test.field.inc';
module_load_include('inc', 'field_test', 'field_test.storage'); require_once DRUPAL_ROOT . '/modules/field/tests/field_test.storage.inc';
/** /**
* Implements hook_permission(). * Implements hook_permission().
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
* Defines a "managed_file" Form API field and a "file" field for Field module. * 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(). * Implements hook_help().
*/ */
...@@ -28,9 +31,6 @@ function file_help($path, $arg) { ...@@ -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(). * 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