When I click the header for each column, the sort doesn't happen. It loads the url (or AJAX) but the view is still the same. Does not work in the views preview page either. I am using Views 2.8 - could it be a views issue? - it works for normal views though.

It used to work (not sure which version sorry) but now when I click the header to sort, the urls (or AJAX) are generated fine but the order is always the same. The views arguments/filters/sort options are largely untouched (left as is except for some theming). Has anyone also had this issue?

You can view my test forum here: http://modspark.com/forums/modding-forums/test-forums

Thanks for the help in advance, and many thanks for the excellent modules Michelle =)

Comments

watbe’s picture

StatusFileSize
new150.88 KB

Here is a screenshot of the views parameters. Thanks again.

watbe’s picture

Status: Active » Closed (fixed)

Nevermind, "Override normal sorting if click sorting is used" was not ticked =)

watbe’s picture

Status: Closed (fixed) » Active

It actually still doesn't work after changing the above setting. But it works if I removed the sort criteria - is it being overriding somehow even when "Override normal sorting if click sorting is used" is checked?

watbe’s picture

Title: Views sorting mechanism not working under the topic list » Click sorting does not override defined sort criteria.
Project: Advanced Forum » Views (for Drupal 7)
Version: 6.x-2.0-alpha2 » 6.x-2.8
Component: Views » table style
Category: bug » support
StatusFileSize
new129.75 KB

This appears to be a Views 2 issue. Try a brand new view with two sort criteria's and sortable fields (in table) and the default sort as none... Click sorting just doesn't seem to work.

Just added a new screenshot to show what I mean.

Here is the exported view:

$view = new view;
$view->name = 'test';
$view->description = 'test';
$view->tag = '';
$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(
  'last_comment_timestamp' => array(
    'label' => 'Last comment time',
    '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,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'date_format' => 'small',
    'custom_date_format' => '',
    'exclude' => 0,
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
    'relationship' => 'none',
  ),
  'title' => array(
    'label' => 'Title',
    '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,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'last_comment_timestamp' => array(
    'order' => 'DESC',
    'granularity' => 'second',
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
    'relationship' => 'none',
  ),
  'sticky' => array(
    'order' => 'DESC',
    'id' => 'sticky',
    'table' => 'node',
    'field' => 'sticky',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'last_comment_timestamp' => 'last_comment_timestamp',
    'title' => 'title',
  ),
  'info' => array(
    'last_comment_timestamp' => array(
      'sortable' => 1,
      'separator' => '',
    ),
    'title' => array(
      'sortable' => 1,
      'separator' => '',
    ),
  ),
  'default' => '-1',
));

I'm putting this under support request just in case I made an amateur mistake, which I'd be glad if someone points it out!

Thanks.

watbe’s picture

Status: Active » Closed (duplicate)

duplicate of this: http://drupal.org/node/657700 thanks to GeekyLass for the heads up =)