Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
dba61c45
Commit
dba61c45
authored
Jan 28, 2010
by
webchick
Browse files
#599122
follow-up by scor and catch: Do not use module_load_include() in global context.
parent
f58a4c72
Changes
4
Show whitespace changes
Inline
Side-by-side
includes/module.inc
View file @
dba61c45
...
...
@@ -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
...
...
modules/field/field.module
View file @
dba61c45
...
...
@@ -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
...
...
modules/field/tests/field_test.module
View file @
dba61c45
...
...
@@ -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
/
test
s/
field_test.entity
.inc
'
;
require_once
DRUPAL_ROOT
.
'/modules/
field
/
test
s/
field_test.field
.inc
'
;
require_once
DRUPAL_ROOT
.
'/modules/
field
/
test
s/
field_test.storage
.inc
'
;
/**
* Implements hook_permission().
...
...
modules/file/file.module
View file @
dba61c45
...
...
@@ -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().
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment