diff --git a/uc_attribute/views/uc_attribute.views.inc b/uc_attribute/views/uc_attribute.views.inc index 6dcff3f..9fb4b5d 100644 --- a/uc_attribute/views/uc_attribute.views.inc +++ b/uc_attribute/views/uc_attribute.views.inc @@ -147,18 +147,20 @@ function uc_attribute_views_data() { ), ); - // Add stock relationship to the adjustments table - $data['uc_product_stock']['sku']['relationship'] = array( - 'base' => 'uc_product_adjustments', - 'base field' => 'model', - 'relationship field' => 'sku', - 'handler' => 'views_handler_relationship', - 'title' => t('Adjustments from stock'), - 'help' => t('Product\'s adjustments from the SKUs in the stock table.'), - 'group' => t('Product attributes'), - ); + return $data; +} + + +/** + * Implements hook_views_data_alter(). + * + * Additions to other ubercart related module views' handlers. + * + * They are added here so that they don't take any preference in a new view + * building process. + */ +function uc_attribute_views_data_alter(&$data) { - // Add viewhandler for uc_order_product attributes $data['uc_order_products']['attributes'] = array( 'title' => t('Ordered product attributes'), 'help' => t('List of attribute selection for the ordered product.'), @@ -170,5 +172,14 @@ function uc_attribute_views_data() { ), ); - return $data; + // Add stock relationship to the adjustments table + $data['uc_product_stock']['sku']['relationship'] = array( + 'base' => 'uc_product_adjustments', + 'base field' => 'model', + 'relationship field' => 'sku', + 'handler' => 'views_handler_relationship', + 'title' => t('Adjustments from stock'), + 'help' => t('Product\'s adjustments from the SKUs in the stock table.'), + 'group' => t('Product attributes'), + ); }