[support] D7 Issue with Views, custom table and sort field

Jeff Greenberg listmail.ayendesigns at gmail.com
Sun Jan 4 18:28:49 UTC 2015


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.

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.

Here is the base information and the field definition. The database field
is varchar.

$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',
    ),
);



-- 
---
drupal.org/user/367108
linkedin.com/in/jeffrgreenberg
accidentalcoder.com / ayendesigns.com
@accidentalcoder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20150104/a05c0122/attachment.html 


More information about the support mailing list