I added an attached display table to a page table display. The attached display has just one field, and it is supposed to do a GROUP BY on that field. There is no GROUP BY. Each record is displayed individually. (The base display does not have aggregation turned on, but the attached display does.)

The field has aggregation settings of "Group results together".

Here is the SQL generated:

SELECT uc_orders.order_status AS uc_orders_order_status
FROM 
{uc_orders} uc_orders
LIMIT 10 OFFSET 0

Note the lack of GROUP BY in the SQL.

Here is the export for just the problem display:

/* Display: Order type count */
$handler = $view->new_display('attachment', 'Order type count', 'attachment_1');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['title'] = 'Order type count';
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['group_by'] = FALSE;
$handler->display->display_options['group_by'] = TRUE;
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['defaults']['relationships'] = FALSE;
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Order: Order status */
$handler->display->display_options['fields']['order_status']['id'] = 'order_status';
$handler->display->display_options['fields']['order_status']['table'] = 'uc_orders';
$handler->display->display_options['fields']['order_status']['field'] = 'order_status';
$handler->display->display_options['defaults']['sorts'] = FALSE;
$handler->display->display_options['displays'] = array(
  'page' => 'page',
  'default' => 0,
);
$handler->display->display_options['inherit_exposed_filters'] = TRUE;

The full export for the view is attached.

CommentFileSizeAuthor
order_view_export_1.txt12.74 KBDanZ

Comments

DanZ’s picture

I know nothing about the export format, but does this mean something?

$handler->display->display_options['defaults']['group_by'] = FALSE;
$handler->display->display_options['group_by'] = TRUE;

That seems right.... Does this mean it's taking the aggregation settings from the attachee display or the master display settings, not the current (attached display) settings?

DanZ’s picture

Issue summary: View changes

Clarified a bit.