I'm trying to define a default sort order, but it won't save. I set the sort order, hit "Update", and even if I go right back to the table configuration it'll have the sort order as "none".

I'm trying to change the "Month view" so that it sorts by the "TIME" column, but it's not saving that change to the database.

Here's the view:

$view = new view;
$view->name = 'bookmans_maincalendar';
$view->description = 'A multi-dimensional calendar view with back/next navigation.';
$view->tag = 'Calendar';
$view->view_php = '';
$view->base_table = 'node';
$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('fields', array(
  'field_start_date_value' => array(
    'label' => 'TIME',
    'link_to_node' => 0,
    'label_type' => 'custom',
    'format' => 'short',
    'multiple' => array(
      'group' => 1,
      'multiple_number' => '1',
      'multiple_from' => '0',
      'multiple_reversed' => 0,
    ),
    'exclude' => 0,
    'id' => 'field_start_date_value',
    'table' => 'node_data_field_start_date',
    'field' => 'field_start_date_value',
    'relationship' => 'none',
  ),
  'title' => array(
    'label' => 'EVENT NAME',
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'tid' => array(
    'label' => 'LOCATION',
    'type' => 'separator',
    'separator' => ', ',
    'empty' => '',
    'link_to_taxonomy' => 1,
    'limit' => 1,
    'vids' => array(
      '2' => 2,
      '11' => 11,
      '4' => 0,
      '1' => 0,
      '16' => 0,
      '19' => 0,
      '12' => 0,
      '13' => 0,
      '21' => 0,
      '3' => 0,
      '7' => 0,
    ),
    'exclude' => 0,
    'id' => 'tid',
    'table' => 'term_node',
    'field' => 'tid',
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'date_argument' => array(
    'default_action' => 'default',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'default_argument_type' => 'date',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'date_fields' => array(
      'node_data_field_start_date.field_start_date_value' => 'node_data_field_start_date.field_start_date_value',
    ),
    'date_method' => 'OR',
    'granularity' => 'month',
    'id' => 'date_argument',
    'table' => 'node',
    'field' => 'date_argument',
    'relationship' => 'none',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'webform' => 0,
      'blog' => 0,
      'activitystream' => 0,
      'image' => 0,
      'forum' => 0,
      'panel' => 0,
      'community_events' => 0,
      'event' => 0,
      'events_concerts' => 0,
      'events_instores' => 0,
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '4' => 0,
      '1' => 0,
      '16' => 0,
      '19' => 0,
      '12' => 0,
      '13' => 0,
      '21' => 0,
      '2' => 0,
      '3' => 0,
      '7' => 0,
      '11' => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_php' => '',
    'default_options_div_prefix' => '',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'community_events' => 'community_events',
      'events_instores' => 'events_instores',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
  'role' => array(),
  'perm' => '',
));
$handler->override_option('empty', 'No current events to show.');
$handler->override_option('empty_format', '4');
$handler->override_option('items_per_page', 0);
$handler->override_option('style_plugin', 'calendar_nav');
$handler = $view->new_display('calendar', 'Calendar page', 'calendar');
$handler->override_option('title', 'Event Calendar');
$handler->override_option('path', 'bookmans/maincalendar');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'weight' => 0,
));
$handler->override_option('calendar_colors', array(
  'page' => '#ffff66',
  'story' => '#668cff',
));
$handler = $view->new_display('calendar_year', 'Year view', 'calendar_year');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'field_start_date_value' => 'field_start_date_value',
    'title' => 'title',
    'tid' => 'tid',
  ),
  'info' => array(
    'field_start_date_value' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'title' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'tid' => array(
      'separator' => '',
    ),
  ),
  'default' => 'field_start_date_value',
));
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', FALSE);
$handler->override_option('displays', array(
  'calendar' => 'calendar',
  'default' => 0,
  'calendar_block' => 0,
));
$handler = $view->new_display('calendar_month', 'Month view', 'calendar_month');
$handler->override_option('fields', array(
  'field_start_date_value' => array(
    'label' => 'TIME',
    'link_to_node' => 0,
    'label_type' => 'custom',
    'format' => 'short',
    'multiple' => array(
      'group' => 1,
      'multiple_number' => '1',
      'multiple_from' => '0',
      'multiple_reversed' => 0,
    ),
    'exclude' => 0,
    'id' => 'field_start_date_value',
    'table' => 'node_data_field_start_date',
    'field' => 'field_start_date_value',
    'relationship' => 'none',
  ),
  'title' => array(
    'label' => 'EVENT NAME',
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'tid' => array(
    'label' => 'LOCATION',
    'type' => 'separator',
    'separator' => ', ',
    'empty' => '',
    'link_to_taxonomy' => 1,
    'limit' => 1,
    'vids' => array(
      '2' => 2,
      '11' => 11,
      '4' => 0,
      '1' => 0,
      '16' => 0,
      '19' => 0,
      '12' => 0,
      '13' => 0,
      '21' => 0,
      '3' => 0,
      '7' => 0,
    ),
    'exclude' => 0,
    'id' => 'tid',
    'table' => 'term_node',
    'field' => 'tid',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
));
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'field_start_date_value' => 'field_start_date_value',
    'title' => 'title',
    'tid' => 'tid',
  ),
  'info' => array(
    'field_start_date_value' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'title' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'tid' => array(
      'separator' => '',
    ),
  ),
  'default' => 'field_start_date_value',
));
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', FALSE);
$handler->override_option('displays', array(
  'calendar' => 'calendar',
  'default' => 0,
  'calendar_block' => 0,
));
$handler = $view->new_display('calendar_day', 'Day view', 'calendar_day');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'title' => 'title',
  ),
  'info' => array(
    'title' => array(
      'sortable' => 0,
      'separator' => '',
    ),
  ),
  'default' => '-1',
));
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', FALSE);
$handler->override_option('displays', array(
  'calendar' => 'calendar',
  'default' => 0,
  'calendar_block' => 0,
));
$handler = $view->new_display('calendar_week', 'Week view', 'calendar_week');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'field_start_date_value' => 'field_start_date_value',
    'title' => 'title',
    'tid' => 'tid',
  ),
  'info' => array(
    'field_start_date_value' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'title' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'tid' => array(
      'separator' => '',
    ),
  ),
  'default' => 'field_start_date_value',
));
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', FALSE);
$handler->override_option('displays', array(
  'calendar' => 'calendar',
  'default' => 0,
  'calendar_block' => 0,
));
$handler = $view->new_display('calendar_block', 'Calendar block', 'calendar_block');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('calendar_block_view', 'Block view', 'calendar_block_view');
$handler->override_option('style_plugin', 'calendar_style');
$handler->override_option('style_options', array(
  'display_type' => 'month',
  'name_size' => '1',
));
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', FALSE);
$handler->override_option('displays', array(
  'calendar_block' => 'calendar_block',
  'default' => 0,
  'calendar' => 0,
));

Comments

arhak’s picture

Status: Active » Postponed (maintainer needs more info)

well, in rc9 I'm experiencing something similar: "many times" the table looses the sort, but not always, so it's saved indeed.
the "many times" seems to be each time I add a new field
so, adding a new field to the view forces me to go back and recheck the default sort in the table

merlinofchaos’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ahh, found it. Was a small typo causing it to think the default sort was set to an invalid field (one that had been removed). Fixed in dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.