<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,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,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,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,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,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial">$data[&#39;product&#39;][&#39;table&#39;][&#39;group&#39;] = t(&#39;Products&#39;);

$data[&#39;product&#39;][&#39;table&#39;][&#39;base&#39;] = array(
    &#39;title&#39; =&gt; t(&#39;Products&#39;),
    &#39;field&#39; =&gt; &#39;pid&#39;,
    &#39;defaults&#39; =&gt; array(
      &#39;field&#39; =&gt; &#39;pid&#39;,
    ),
);
$data[&#39;product&#39;][&#39;manufacturer_name&#39;] = array(
    &#39;title&#39; =&gt; t(&#39;Manufacturer Name&#39;),
    &#39;field&#39; =&gt; array(
        &#39;handler&#39; =&gt; &#39;views_handler_field&#39;,
    ),
    &#39;sort&#39; =&gt; array(
        &#39;handler&#39; =&gt; &#39;views_handler_sort&#39;,
    ),
    &#39;filter&#39; =&gt; array(
        &#39;handler&#39; =&gt; &#39;views_handler_filter_string&#39;,
    ),
    &#39;argument&#39; =&gt; array(
        &#39;handler&#39; =&gt; &#39;views_handler_argument_string&#39;,
    ),
);
</code></pre><div><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,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>