New DB field won't appear in Views I am trying to hack a crowdfunding module for Ubercart so that it lets certain vital pieces of information, such as funding goals and the amount already contributed, be displayed on the project pages.

I figured that a good way to do this would be to create a view that would display this information, and then make that the default view for the relevant node-type. Unfortunately, I can't get any fields from the uc_crowdfunding table to appear in the view editor. I even followed this guide should do the trick, as was suggested in this answer.

My added code is as follows:

uc_crowdfunding.module

/**
 * Implements hook_views_api()
 */
function uc_crowdfunding_views_api() {
  return array(
    'api' =&gt; '3.0',
    'path' =&gt; drupal_get_path('module', 'uc_crowdfunding') . '/views',
  );
}


uc_crowdfunding.views.inc



    /**
     * @file
     * Views hooks for UC crowdfunding projects.
     */

    /**
     * Implements hook_views_data().
     */
    function uc_crowdfunding_views_data() {
      $data['uc_crowdfunding_products'] = array(
        'table' =&gt; array(
          'group' =&gt; 'Crowdfunding: Crowdfunding products',
          'base' =&gt; array(),
        ),
        'cfid' =&gt; array(),
        'pfid' =&gt; array(),
        'dateline' =&gt; array(),
        'target' =&gt; array(),
        'type' =&gt; array(),
      );
      $data['uc_crowdfunding_products']['table']['base'] = array(
        'field' =&gt; 'cfid',
        'title' =&gt; t('Crowdfunding product'),
        'help' =&gt; t('Data for each crowdfunding product.'),
      );

      // Let's join some tables, eh?
      $data['uc_product_features'] = array(
        'pfid' =&gt; array(),
        'nid' =&gt; array(),
        'fid' =&gt; array(),
        'description' =&gt; array(),
      );
      $data['uc_product_features']['join']['uc_crowdfunding_products'] = array(
        'left_field' =&gt; 'nid',
        'field' =&gt; 'nid',
      );

      // Here are some fields
      $data['uc_crowdfunding_products']['target'] = array(
        'title' =&gt; t('Fundraising goal'),
        'help' =&gt; t('I guess that this is the amount of money that you\'re supposed to raise, huh?'),
        'field' =&gt; array(
          'handler' =&gt; 'views_handler_field_numeric',
          'click sortable' =&gt; TRUE,
        ),
        'sort' =&gt; array(
          'handler' =&gt; 'views_handler_sort_group_by_numeric',
        ),
        'filter' =&gt; array(
          'handler' =&gt; 'views_handler_filter_numeric',
        ),
      );

      return $data;
    }


EDIT: There was also this piece of code, which I had commented out earlier for some reason:

$data['uc_products']['join']['uc_crowdfunding_products'] = array(
  'left_table' =&gt; 'uc_product_features',
  'left_field' =&gt; 'nid',
  'field' =&gt; 'nid',
);
You might want to go about this in a different way, like adding a views handler to the module, but I took the question as how to get data from "uc_crowdfunding_products" table into Views. It also seems like the tables mentioned had Node IDs so I made a relationship there. You were pretty close with your code. 

Before getting too fancy with relationships and joins, make sure the following basic code works. It adds the ability to list the target field from the products table and some field from the features table with any node associated with them. You'll want to add the node revisions tables if you have revisions on your site. You can also look at the Data project to give you an idea of how to adopt database tables into Drupal.

/**
 * @file
 * Views hooks for UC crowdfunding projects.
 */

/**
 * Implements hook_views_data().
 */
function uc_crowdfunding_views_data() {
  $data['uc_crowdfunding_products'] = array(
    'table' =&gt; array(
      'group' =&gt; 'Crowdfunding',
      'base' =&gt; array(
        'field' =&gt; 'nid',
        'title' =&gt; t('Crowdfunding Products'),
        'help' =&gt; t('Data for each crowdfunding product.'),
        ),
      'join' =&gt; array(
        'node' =&gt; array(
        'left_field' =&gt; 'nid',
        'field' =&gt; 'nid',
         ),
      ),
    ),
  );

  $data['uc_crowdfunding_products']['nid'] = array(
    'title' =&gt; t('Example content'), 
    'help' =&gt; t('Some example content that references a node.'),
    'relationship' =&gt; array(
      'base' =&gt; 'node',
      'field' =&gt; 'nid',
      'handler' =&gt; 'views_handler_relationship', 
      'label' =&gt; t('Example node'),
    ),
  );

  $data['uc_crowdfunding_products']['target'] = array(
    'title' =&gt; t('Crowdfunding Target'), 
    'help' =&gt; t('Just a numeric field.'), 
    'field' =&gt; array(
      'handler' =&gt; 'views_handler_field_numeric', 
      'click sortable' =&gt; TRUE,
    ), 
    'filter' =&gt; array(
      'handler' =&gt; 'views_handler_filter_numeric',
    ), 
    'sort' =&gt; array(
      'handler' =&gt; 'views_handler_sort',
    ),
  );

  $data['uc_product_features'] = array(
    'table' =&gt; array(
      'group' =&gt; 'Crowdfunding',
      'base' =&gt; array(
        'field' =&gt; 'nid',
        'title' =&gt; t('Crowdfunding something'),
        'help' =&gt; t('Data for each crowdfunding product.'),
        ),
      'join' =&gt; array(
        'node' =&gt; array(
        'left_field' =&gt; 'nid',
        'field' =&gt; 'nid',
         ),
      ),
    ),
  );

  $data['uc_product_features']['nid'] = array(
    'title' =&gt; t('Example content'), 
    'help' =&gt; t('Some example content that references a node.'),
    'relationship' =&gt; array(
      'base' =&gt; 'node',
      'field' =&gt; 'nid',
      'handler' =&gt; 'views_handler_relationship', 
      'label' =&gt; t('Example node'),
    ),
  );

  $data['uc_product_features']['some_field'] = array(
    'title' =&gt; t('Crowdfunding field'), 
    'help' =&gt; t('Just a numeric field.'), 
    'field' =&gt; array(
      'handler' =&gt; 'views_handler_field_numeric', 
      'click sortable' =&gt; TRUE,
    ), 
    'filter' =&gt; array(
      'handler' =&gt; 'views_handler_filter_numeric',
    ), 
    'sort' =&gt; array(
      'handler' =&gt; 'views_handler_sort',
    ),
  );

  return $data;
}