diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-10-13 16:38:43 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-10-13 16:38:43 +0000 |
commit | fbfa7a4150a40d6df9347692bb6681f45f804c7d (patch) | |
tree | 425db0f6cc7b72b8a9350c5a462fe718e0ed2877 /modules/field/field.attach.inc | |
parent | f67e438b4196a6bc79c0da576da0a9e09fedb612 (diff) | |
download | brdo-fbfa7a4150a40d6df9347692bb6681f45f804c7d.tar.gz brdo-fbfa7a4150a40d6df9347692bb6681f45f804c7d.tar.bz2 |
- Patch #593522 by sun: a better and faster drupal_alter().
Diffstat (limited to 'modules/field/field.attach.inc')
-rw-r--r-- | modules/field/field.attach.inc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/field/field.attach.inc b/modules/field/field.attach.inc index 01abd6f78..4118a60e1 100644 --- a/modules/field/field.attach.inc +++ b/modules/field/field.attach.inc @@ -1193,7 +1193,13 @@ function field_attach_view($obj_type, $object, $build_mode = 'full', $langcode = $output['#extra_fields'] = field_extra_fields($bundle); // Let other modules make changes after rendering the view. - drupal_alter('field_attach_view', $output, $obj_type, $object, $build_mode, $langcode); + $context = array( + 'obj_type' => $obj_type, + 'object' => $object, + 'build_mode' => $build_mode, + 'langcode' => $langcode, + ); + drupal_alter('field_attach_view', $output, $context); return $output; } @@ -1228,7 +1234,12 @@ function field_attach_preprocess($obj_type, $object, $element, &$variables) { } // Let other modules make changes to the $variables array. - drupal_alter('field_attach_preprocess', $variables, $obj_type, $object, $element); + $context = array( + 'obj_type' => $obj_type, + 'object' => $object, + 'element' => $element, + ); + drupal_alter('field_attach_preprocess', $variables, $context); } /** |