From 37c3c7ec7aff7fad84b3839ac3fa5437b7b256b2 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 30 Jul 2010 02:47:28 +0000 Subject: - Patch #769226 by Owen Barton, alanburke, sun: fixed JS/CSS preprocess should default to FALSE. --- modules/field/field.attach.inc | 4 ---- modules/field/field.module | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'modules/field') diff --git a/modules/field/field.attach.inc b/modules/field/field.attach.inc index 3753b2f75..3383a5793 100644 --- a/modules/field/field.attach.inc +++ b/modules/field/field.attach.inc @@ -542,7 +542,6 @@ function field_attach_form($entity_type, $entity, &$form, &$form_state, $langcod // Add custom weight handling. list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); - $form['#attached']['css'][] = drupal_get_path('module', 'field') . '/theme/field.css'; $form['#pre_render'][] = '_field_extra_fields_pre_render'; $form['#entity_type'] = $entity_type; $form['#bundle'] = $bundle; @@ -1129,9 +1128,6 @@ function field_attach_view($entity_type, $entity, $view_mode, $langcode = NULL) $output['#entity_type'] = $entity_type; $output['#bundle'] = $bundle; - // Include CSS styles. - $output['#attached']['css'][] = drupal_get_path('module', 'field') . '/theme/field.css'; - // Let other modules alter the renderable array. $context = array( 'entity_type' => $entity_type, diff --git a/modules/field/field.module b/modules/field/field.module index e421d9742..a429499f7 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -165,6 +165,13 @@ function field_theme() { ); } +/** + * Implements hook_init(). + */ +function field_init() { + drupal_add_css(drupal_get_path('module', 'field') . '/theme/field.css', array('preprocess' => TRUE)); +} + /** * Implements hook_cron(). * @@ -811,7 +818,6 @@ function field_view_field($entity_type, $entity, $field_name, $display = array() if (isset($result[$field_name])) { $output = $result[$field_name]; - $output['#attached']['css'][] = drupal_get_path('module', 'field') . '/theme/field.css'; } } -- cgit v1.2.3