I have a view that pull in some custom defined table information. But when I attach a CSV feed to it, there are no commas. So its not really a CSV file :) All the data is there correctly, but with no commas.

This works just fine on other views on the same site, and the XLS version seems to be properly formatted (although Excel seems to think it's "corrupted", even though it looks right).

Anyone else running into this?

Here is the exported view:

$view = new view;
$view->name = 'transactions';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'kwwoa_advanced_reports';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
  'oid' => array(
    'label' => 'Order',
    'required' => 0,
    'id' => 'oid',
    'table' => 'kwwoa_advanced_reports',
    'field' => 'oid',
    'relationship' => 'none',
  ),
  'uid' => array(
    'label' => 'User',
    'required' => 0,
    'id' => 'uid',
    'table' => 'kwwoa_advanced_reports',
    'field' => 'uid',
    'relationship' => 'none',
  ),
  'content_profile_rel' => array(
    'label' => 'Associate',
    'required' => 0,
    'type' => 'associate_profile',
    'id' => 'content_profile_rel',
    'table' => 'users',
    'field' => 'content_profile_rel',
    'relationship' => 'uid',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'content_profile_rel_1' => array(
    'label' => 'Operator',
    'required' => 0,
    'type' => 'profile',
    'id' => 'content_profile_rel_1',
    'table' => 'users',
    'field' => 'content_profile_rel',
    'relationship' => 'uid',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('fields', array(
  'uid' => array(
    'label' => 'Uid',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_user' => 1,
    'exclude' => 0,
    'id' => 'uid',
    'table' => 'users',
    'field' => 'uid',
    'relationship' => 'uid',
  ),
  'field_first_name_value' => array(
    'label' => 'First Name',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'label_type' => 'widget',
    'format' => 'default',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 1,
    'id' => 'field_first_name_value',
    'table' => 'node_data_field_first_name',
    'field' => 'field_first_name_value',
    'relationship' => 'content_profile_rel',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'field_last_name_value' => array(
    'label' => 'Last Name',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'label_type' => 'widget',
    'format' => 'default',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 1,
    'id' => 'field_last_name_value',
    'table' => 'node_data_field_last_name',
    'field' => 'field_last_name_value',
    'relationship' => 'content_profile_rel',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'field_first_name_value_1' => array(
    'label' => 'First Name',
    'alter' => array(
      'alter_text' => 1,
      'text' => '[field_first_name_value][field_first_name_value_1]',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'label_type' => 'widget',
    'format' => 'default',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 0,
    'id' => 'field_first_name_value_1',
    'table' => 'node_data_field_first_name',
    'field' => 'field_first_name_value',
    'relationship' => 'content_profile_rel_1',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'field_last_name_value_1' => array(
    'label' => 'Last Name',
    'alter' => array(
      'alter_text' => 1,
      'text' => '[field_last_name_value][field_last_name_value_1] ',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'label_type' => 'widget',
    'format' => 'default',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 0,
    'id' => 'field_last_name_value_1',
    'table' => 'node_data_field_last_name',
    'field' => 'field_last_name_value',
    'relationship' => 'content_profile_rel_1',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'order_id' => array(
    'label' => 'Order ID',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_order' => 1,
    'exclude' => 0,
    'id' => 'order_id',
    'table' => 'uc_orders',
    'field' => 'order_id',
    'relationship' => 'oid',
  ),
  'payment_method' => array(
    'label' => 'Payment method',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'payment_method',
    'table' => 'uc_orders',
    'field' => 'payment_method',
    'relationship' => 'oid',
  ),
  'payment_info' => array(
    'id' => 'payment_info',
    'table' => 'kwwoa_advanced_reports',
    'field' => 'payment_info',
  ),
  'order_status' => array(
    'id' => 'order_status',
    'table' => 'uc_orders',
    'field' => 'order_status',
  ),
  'contact_email' => array(
    'id' => 'contact_email',
    'table' => 'kwwoa_advanced_reports',
    'field' => 'contact_email',
  ),
  'time_entered' => array(
    'label' => 'Date',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'date_format' => 'custom',
    'custom_date_format' => 'M j, Y',
    'exclude' => 0,
    'id' => 'time_entered',
    'table' => 'kwwoa_advanced_reports',
    'field' => 'time_entered',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'KLA' => array(
    'label' => 'KLA',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'KLA',
    'table' => 'kwwoa_advanced_reports',
    'field' => 'KLA',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'field_last_name_value' => array(
    'operator' => 'contains',
    'value' => '',
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 0,
      'operator' => 'field_last_name_value_op',
      'identifier' => 'field_last_name_value',
      'label' => 'Associate Last Name',
      'optional' => 1,
      'remember' => 0,
    ),
    'case' => 0,
    'id' => 'field_last_name_value',
    'table' => 'node_data_field_last_name',
    'field' => 'field_last_name_value',
    'relationship' => 'content_profile_rel',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'field_last_name_value_1' => array(
    'operator' => 'contains',
    'value' => '',
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 0,
      'operator' => 'field_last_name_value_1_op',
      'identifier' => 'field_last_name_value_1',
      'label' => 'Operator Last Name',
      'optional' => 1,
      'remember' => 0,
    ),
    'case' => 0,
    'id' => 'field_last_name_value_1',
    'table' => 'node_data_field_last_name',
    'field' => 'field_last_name_value',
    'relationship' => 'content_profile_rel_1',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'order_id' => array(
    'operator' => '=',
    'value' => array(
      'value' => '',
      'min' => '',
      'max' => '',
    ),
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 0,
      'operator' => 'order_id_op',
      'identifier' => 'order_id',
      'label' => 'Order ID',
      'optional' => 1,
      'remember' => 0,
    ),
    'id' => 'order_id',
    'table' => 'uc_orders',
    'field' => 'order_id',
    'relationship' => 'oid',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'payment_method' => array(
    'operator' => 'in',
    'value' => array(),
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 0,
      'operator' => 'payment_method_op',
      'identifier' => 'payment_method',
      'label' => 'Payment method',
      'optional' => 1,
      'single' => 1,
      'remember' => 0,
      'reduce' => 0,
    ),
    'id' => 'payment_method',
    'table' => 'uc_orders',
    'field' => 'payment_method',
    'relationship' => 'oid',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'order_status' => array(
    'operator' => 'in',
    'value' => array(),
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 0,
      'operator' => 'order_status_op',
      'identifier' => 'order_status',
      'label' => 'Order Status',
      'optional' => 1,
      'single' => 1,
      'remember' => 0,
      'reduce' => 0,
    ),
    'id' => 'order_status',
    'table' => 'uc_orders',
    'field' => 'order_status',
    'relationship' => 'oid',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'payment_info' => array(
    'operator' => 'contains',
    'value' => '',
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 0,
      'operator' => 'payment_info_op',
      'identifier' => 'payment_info',
      'label' => 'Extra Payment Info',
      'optional' => 1,
      'remember' => 0,
    ),
    'case' => 0,
    'id' => 'payment_info',
    'table' => 'kwwoa_advanced_reports',
    'field' => 'payment_info',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'role',
  'role' => array(
    '3' => 3,
    '10' => 10,
  ),
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('title', 'Transactions');
$handler->override_option('items_per_page', 100);
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'uid' => 'uid',
    'field_first_name_value' => 'field_first_name_value',
    'field_last_name_value' => 'field_last_name_value',
    'field_first_name_value_1' => 'field_first_name_value_1',
    'field_last_name_value_1' => 'field_last_name_value_1',
    'order_id' => 'order_id',
    'payment_method' => 'payment_method',
    'payment_info' => 'payment_info',
    'order_status' => 'order_status',
    'contact_email' => 'contact_email',
    'time_entered' => 'time_entered',
  ),
  'info' => array(
    'uid' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'field_first_name_value' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'field_last_name_value' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'field_first_name_value_1' => array(
      'sortable' => 1,
      'separator' => '',
    ),
    'field_last_name_value_1' => array(
      'sortable' => 1,
      'separator' => '',
    ),
    'order_id' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'payment_method' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'payment_info' => array(
      'separator' => '',
    ),
    'order_status' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'contact_email' => array(
      'separator' => '',
    ),
    'time_entered' => array(
      'sortable' => 1,
      'separator' => '',
    ),
  ),
  'default' => '-1',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'transactions');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler = $view->new_display('feed', 'Feed', 'feed_1');
$handler->override_option('style_plugin', 'views_csv');
$handler->override_option('style_options', array(
  'mission_description' => FALSE,
  'description' => '',
  'attach_text' => 'CSV',
  'provide_file' => 1,
  'filename' => 'view-%view.csv',
  'parent_sort' => 0,
  'separator' => ',',
  'quote' => 1,
  'trim' => 0,
  'header' => 1,
));
$handler->override_option('row_plugin', '');
$handler->override_option('path', 'transactions-csv');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('displays', array(
  'page_1' => 'page_1',
  'default' => 0,
));
$handler->override_option('sitename_title', FALSE);

Comments

gbernier’s picture

Hey Jazz,

I'm experience the same issue with the dev version, I created a view, attached it to a page it's using fields exposed by uc_views module. No matter what the separator isn't showing up. Be great to see that addressed.

I'm using the latest dev version as well.

Cheers,
Gene Bernier

gbernier’s picture

Hey Just a quick reply, it's something to do with the tpl, I took out $separator and replaced it with just "," and it worked fine.

alan mccoll’s picture

Worked for me too. Thanks, gbernier.
I changed these two lines in the file, drupalroot/sites/all/modules/views_bonus/export/views-bonus-export-csv.tpl.php

// Print out header row, if option was selected.
if ($options['header']) {
//  print implode($separator, $header) . "\r\n";
 print implode(",", $header) . "\r\n";
}

// Print out exported items.
foreach ($themed_rows as $count => $item_row):
//  print implode($separator, $item_row) . "\r\n";
print implode(",", $item_row) . "\r\n";
endforeach;
srees’s picture

This bug is due to a typo in the spelling correction logic, lol!

Line 16 of views_bonus_export.theme.inc

Currently:
if (isset($vars['options']['separator'])) {

Should be:
if (isset($vars['options']['seperator'])) {

neclimdul’s picture

Status: Active » Closed (outdated)