Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
28725705
Commit
28725705
authored
Jan 02, 2010
by
Dries Buytaert
Browse files
- Patch
#672494
by catch: small performance optimization for field_access().
parent
8f6e5a46
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/field/field.module
View file @
28725705
...
...
@@ -704,13 +704,14 @@ function field_has_data($field) {
function
field_access
(
$op
,
$field
,
$obj_type
,
$object
=
NULL
,
$account
=
NULL
)
{
global
$user
;
if
(
is
_null
(
$account
))
{
if
(
!
is
set
(
$account
))
{
$account
=
$user
;
}
$field_access
=
module_invoke_all
(
'field_access'
,
$op
,
$field
,
$obj_type
,
$object
,
$account
);
foreach
(
$field_access
as
$value
)
{
if
(
$value
===
FALSE
)
{
foreach
(
module_implements
(
'field_access'
)
as
$module
)
{
$function
=
$module
.
'_field_access'
;
$access
=
$function
(
$op
,
$field
,
$obj_type
,
$object
,
$account
);
if
(
$access
===
FALSE
)
{
return
FALSE
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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