summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-28 20:24:08 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-28 20:24:08 +0000
commit5af362233e013e9374ddcf28044edcef87f4336a (patch)
tree51d4e4acf30be33bd5ff2efb54cd6009088f8c5d /modules
parent690c14e8577ec2bee989c4cef0894a2acb4774ab (diff)
downloadbrdo-5af362233e013e9374ddcf28044edcef87f4336a.tar.gz
brdo-5af362233e013e9374ddcf28044edcef87f4336a.tar.bz2
- Patch #658302 by yched: repurpose hook_field_sanitize() into hook_field_prepare_view().
Diffstat (limited to 'modules')
-rw-r--r--modules/field/field.attach.inc13
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/field/field.attach.inc b/modules/field/field.attach.inc
index 052d22811..8ec1786f1 100644
--- a/modules/field/field.attach.inc
+++ b/modules/field/field.attach.inc
@@ -134,7 +134,6 @@ define('FIELD_STORAGE_INSERT', 'insert');
* - update
* - delete
* - delete revision
- * - sanitize
* - view
* - prepare translation
* @param $obj_type
@@ -240,6 +239,7 @@ function _field_invoke($op, $obj_type, $object, &$a = NULL, &$b = NULL, $options
* @param $op
* Possible operations include:
* - load
+ * - prepare_view
* For all other operations, use _field_invoke() / field_invoke_default()
* instead.
* @param $obj_type
@@ -1162,21 +1162,20 @@ function field_attach_prepare_view($obj_type, $objects, $view_mode = 'full') {
* A renderable array for the field values.
*/
function field_attach_view($obj_type, $object, $view_mode = 'full', $langcode = NULL) {
- // If no language is provided use the current UI language.
+ // Invoke field_default_view(). If no language is provided, use the current
+ // UI language.
$options = array('language' => field_multilingual_valid_language($langcode, FALSE));
-
- // Let field modules sanitize their data for output.
$null = NULL;
- _field_invoke('sanitize', $obj_type, $object, $null, $null, $options);
-
$output = _field_invoke_default('view', $obj_type, $object, $view_mode, $null, $options);
// Add custom weight handling.
list($id, $vid, $bundle) = entity_extract_ids($obj_type, $object);
- $output['#attached']['css'][] = drupal_get_path('module', 'field') . '/theme/field.css';
$output['#pre_render'][] = '_field_extra_weights_pre_render';
$output['#extra_fields'] = field_extra_fields($bundle);
+ // Include CSS styles.
+ $output['#attached']['css'][] = drupal_get_path('module', 'field') . '/theme/field.css';
+
// Let other modules alter the renderable array.
$context = array(
'obj_type' => $obj_type,