<div dir="ltr"><div class="" itemprop="text" style="margin:0px 5px 5px 0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;word-wrap:break-word;width:660px;line-height:17.8048000335693px;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;background-image:initial;background-repeat:initial"><p style="margin:0px 0px 1em;padding:0px;border:0px;vertical-align:baseline;clear:both;background:transparent">I have a custom table defined in Drupal 7 using hook_views_api() and hook_views_data(). The table shows up in the available sources as it should, and its fields show up within the view as they should.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;vertical-align:baseline;clear:both;background:transparent">If I simply select the field I want, the preview shows a list of values as it should. However, if I select that same field to be used as the sort, although no error is given, there is no preview data.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;vertical-align:baseline;clear:both;background:transparent">Here is the base information and the field definition. The database field is varchar.</p><pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;background:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial">$data['product']['table']['group'] = t('Products');
$data['product']['table']['base'] = array(
'title' => t('Products'),
'field' => 'pid',
'defaults' => array(
'field' => 'pid',
),
);
$data['product']['manufacturer_name'] = array(
'title' => t('Manufacturer Name'),
'field' => array(
'handler' => 'views_handler_field',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
);
</code></pre><div><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial"><br></code></div></div><div><br></div>-- <br><div class="gmail_signature">---<div><a href="http://drupal.org/user/367108" target="_blank">drupal.org/user/367108</a></div><div><a href="http://linkedin.com/in/jeffrgreenberg" target="_blank">linkedin.com/in/jeffrgreenberg</a></div><div><a href="http://accidentalcoder.com" target="_blank">accidentalcoder.com</a> / <a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a></div><div>@accidentalcoder</div></div>
</div>