? .git
? .gitignore
? 0-views-file_managed_extras.patch
? 1000480-pager-quantity.patch
? 1002744-use-entity_load.patch
? 1006644-fields-no_bundle.patch
? 1006644-fields-no_bundle.pathc
? 1007036-history-join.patch
? 1007466-add_where_expression.patch
? 1007730-filter_string.patch
? 1007886-relationship-alias.patch
? 1008706-placeholders.patch
? 1011334-exposed_form-sql.patch
? 1013666-block_rename.patch
? 1016058-fix_all_words.patch
? 1017128-field_field-delta.patch
? 1017254-argument_string.patch
? 1018766-click_sort.patch
? 1018802-add_where_expression.patch
? 1018872-field_field-base_field.patch
? 1019438-illegal_choice-fix.patch
? 1022052-field_info.patch
? 1023456-many_to_one.patch
? 1023558_2.patch
? 1024586-rename_fieldapi.patch
? 1027538-format.patch
? 1034532-format-export.patch
? 1035168-strict-fix.patch
? 1043078-fix_filter_groups.patch
? 1043078-fix_filter_groups.patcu
? 1044250-notice.patch
? 522318-views-display_description-human_name_1.patch
? 563020_views_object_cache_0.patch
? 667950-javascript-states-revert_1.patch
? 667950-javascript-states-revert_1_0.patch
? 667950-javascript-states-revert_1_0_2_0.patch
? 687564-convert.patch
? 694094-drupal_static.patch
? 741234_views_empty_arg_check_null.patch
? 863478-distinct-support-broken.patch
? 870792-validation.patch
? 870792_1.patch
? 881060.patch
? 884730.patch
? 894618-filter_date-between.patch
? 895046-field_multiple.patch
? 895046-followup.patch
? 930582-fix.patch
? 931552-fix.patch
? 931886.patch
? 931886_0.patch
? 936196-direct-loading.patch
? 936196-fix.patch
? 949526-external-db.patch
? 952636-filter.7.patch
? 955464-fix.patch
? 955464-many_to_one-add_filter.patch
? 955464-many_to_one.patch
? 957284-search_filter.patch
? 960528-tablesort.patch
? 960596-quote.patch
? 960648-comment_view-link.patch
? 963372-process_checkbox.patch
? 963454.patch
? 971326-join_deleted.patch
? 972934-desperate-try.patch
? 972934-try.patch
? 973698-theme_suggestion-field_field.patch
? 974542-notice-pre_render.patch
? 975400-refactor-field_render.patch
? 975400-refactor-field_render.ptach
? 976098-field-drupal_render-notice.patch
? 983460-table-default_sort-7.patch
? 983460-table-default_sort.patch
? 984390-pager.patch
? 985602-slave.patch
? 985602.patch
? 988490-global_counter.patch
? 988520-date_filter-offset.patch
? 992704-views-groupby.patch
? 993002-1_fix_notice.patch
? 993982-preprocess_fields-notice.patch
? 997424-drupal_add_library.patch
? 998278-field_data-etid-entity_type.patch
? 999330-entity-row.patch
? FALSE,
? add_where_expression
? argument_default_validate-strict.patch
? base_table
? d7_views_taxonomy_handlers.patch
? filter_format_4.patch
? foo.patch
? kat.patch
? multiple.patch
? notices.patch
? revert.patch
? search.patch
? semantic.patch
? table-class-fix.patch
? taxonomy-ref.patch
? taxonomy.patch
? view-
? views-b
? views-field-comment-node-link-call-time-pass-by-reference.patch
? views-filter_numeric_test_0.patch
? views-or.patch
? views-term_fields_contain_tid_only.patch
? views-term_fields_contain_tid_only.patch.1
? views-test-user_argument_default.patch
? views.aggregator_feed_item_id.patch
? views_aggregator_fid_filter.patch
? views_filter_date.patch
? views_formatter_settings-884730-
? views_formatter_settings-884730-43.patch
? views_formatter_settings-884730-61.patch
? views_formatter_settings-884730-63.patch
? views_formatter_settings.patch
? help/localization.html
? modules/filter.views_convert.inc
? modules/system.views_convert.inc
? modules/field/views_handler_field_field_multiple.inc
? tests/field
? tests/taxonomy
? tests/views_handler_filter_date.test
Index: views.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/views.module,v
retrieving revision 1.341.4.53
diff -u -p -r1.341.4.53 views.module
--- views.module	6 Jan 2011 00:37:05 -0000	1.341.4.53
+++ views.module	30 Jan 2011 10:24:22 -0000
@@ -817,10 +817,34 @@ function views_include_default_views($re
  *   An instance of a handler object. May be views_handler_broken.
  */
 function views_get_handler($table, $field, $key, $override = NULL) {
+  static $recursion_protection = array();
+
   $data = views_fetch_data($table);
   $handler = NULL;
 
   if (isset($data[$field][$key])) {
+    // Support old views_data entries conversion.
+    if (isset($data[$field][$key]['moved to'])) {
+      list($moved_table, $moved_field) = $data[$field][$key]['moved to'];
+      if (!empty($recursion_protection[$moved_table][$moved_field])) {
+        // recursion detected!
+        return NULL;
+      }
+      $recursion_protection[$moved_table][$moved_field] = TRUE;
+      $handler = views_get_handler($moved_table, $moved_field, $key, $override);
+      $recursion_protection = array();
+      if ($handler) {
+        // store these values so we know what we were originally called.
+        $handler->original_table = $table;
+        $handler->original_field = $field;
+        if (empty($handler->actual_table)) {
+          $handler->actual_table = $moved_table;
+          $handler->actual_field = $moved_field;
+        }
+      }
+      return $handler;
+    }
+
     // Set up a default handler:
     if (empty($data[$field][$key]['handler'])) {
       $data[$field][$key]['handler'] = 'views_handler_' . $key;
@@ -838,7 +862,7 @@ function views_get_handler($table, $fiel
   }
 
   // DEBUG -- identify missing handlers
-  debug("Missing handler: $table $field $key");
+  vpr("Missing handler: $table $field $key");
   $broken = array(
     'title' => t('Broken handler @table.@field', array('@table' => $table, '@field' => $field)),
     'handler' => 'views_handler_' . $key . '_broken',
Index: modules/field.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/Attic/field.views.inc,v
retrieving revision 1.1.2.20
diff -u -p -r1.1.2.20 field.views.inc
--- modules/field.views.inc	26 Jan 2011 21:20:12 -0000	1.1.2.20
+++ modules/field.views.inc	30 Jan 2011 10:24:23 -0000
@@ -107,13 +107,16 @@ function field_views_field_default_views
   foreach ($tables as $type => $table) {
     if ($type == FIELD_LOAD_CURRENT) {
       $group = t('Fields');
-      $column = 'entity_id';
+      $old_column = 'entity_id';
+      $column = $field['field_name'];
     }
     else {
       $group = t('Fields (historical data)');
-      $column = 'revision_id';
+      $old_column = 'revision_id';
+      $column = $field['field_name'] . '-' . $old_column;
     }
 
+    $data[$table][$old_column]['field']['moved to'] = array($table, $column);
     $data[$table][$column] = array(
       'group' => $group,
       'title' => $title_short,
Index: tests/views_module.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/tests/Attic/views_module.test,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 views_module.test
--- tests/views_module.test	17 Dec 2010 21:51:42 -0000	1.1.2.3
+++ tests/views_module.test	30 Jan 2011 10:24:24 -0000
@@ -14,6 +14,19 @@ class viewsModuleTest extends ViewsSqlTe
     parent::setUp();
   }
 
+  public function viewsData() {
+    $data = parent::viewsData();
+    $data['views_test_previous'] = array();
+    $data['views_test_previous']['id']['field']['moved to'] = array('views_test', 'id');
+    $data['views_test_previous']['id']['filter']['moved to'] = array('views_test', 'id');
+    $data['views_test']['age_previous']['field']['moved to'] = array('views_test', 'age');
+    $data['views_test']['age_previous']['sort']['moved to'] = array('views_test', 'age');
+    $data['views_test_previous']['name_previous']['field']['moved to'] = array('views_test', 'name');
+    $data['views_test_previous']['name_previous']['argument']['moved to'] = array('views_test', 'name');
+
+    return $data;
+  }
+
   public function test_views_trim_text() {
     // Test unicode, @see http://drupal.org/node/513396#comment-2839416
     $text = array(
@@ -76,4 +89,63 @@ class viewsModuleTest extends ViewsSqlTe
     $registry = theme_get_registry();
     $this->assertTrue(isset($registry['views_view__frontpage']));
   }
+
+  /**
+   * Test the views_get_handler method.
+   */
+  function testviews_get_handler() {
+    $types = array('field', 'area', 'filter');
+    foreach ($types as $type) {
+      $handler = views_get_handler($this->randomName(), $this->randomName(), $type);
+      $this->assertEqual('views_handler_' . $type . '_broken', get_class($handler), t('Take sure that a broken handler of type: @type are created', array('@type' => $type)));
+    }
+
+    $views_data = $this->viewsData();
+    $test_tables = array('views_test' => array('id', 'name'));
+    foreach ($test_tables as $table => $fields) {
+      foreach ($fields as $field) {
+        $data = $views_data[$table][$field];
+        foreach ($data as $id => $field_data) {
+          if (!in_array($id, array('title', 'help'))) {
+            $handler = views_get_handler($table, $field, $id);
+            $this->assertInstanceHandler($handler, $table, $field, $id);
+          }
+        }
+      }
+    }
+
+    // Test the automatic conversion feature.
+
+    // Test the automatic table renaming.
+    $handler = views_get_handler('views_test_previous', 'id', 'field');
+    $this->assertInstanceHandler($handler, 'views_test', 'id', 'field');
+    $handler = views_get_handler('views_test_previous', 'id', 'filter');
+    $this->assertInstanceHandler($handler, 'views_test', 'id', 'filter');
+
+    // Test the automatic field renaming.
+    $handler = views_get_handler('views_test', 'age_previous', 'field');
+    $this->assertInstanceHandler($handler, 'views_test', 'age', 'field');
+    $handler = views_get_handler('views_test', 'age_previous', 'sort');
+    $this->assertInstanceHandler($handler, 'views_test', 'age', 'sort');
+
+    // Test the automatic table and field renaming.
+    $handler = views_get_handler('views_test_previous', 'name_previous', 'field');
+    $this->assertInstanceHandler($handler, 'views_test', 'name', 'field');
+    $handler = views_get_handler('views_test_previous', 'name_previous', 'argument');
+    $this->assertInstanceHandler($handler, 'views_test', 'name', 'argument');
+
+    // Test the override handler feature.
+    $handler = views_get_handler('views_test', 'job', 'filter', 'views_handler_filter');
+    $this->assertEqual('views_handler_filter', get_class($handler));
+  }
+
+  /**
+   * Ensure that a certain handler is a instance of a certain table/field.
+   */
+  function assertInstanceHandler($handler, $table, $field, $id) {
+    $table_data = views_fetch_data($table);
+    $field_data = $table_data[$field][$id];
+
+    $this->assertEqual($field_data['handler'], get_class($handler));
+  }
 }
