Hi

I update views (from 6.x-2.6 version to latest dev version, no other changes) and Sorting by Node: Last comment time stop to work

It doesn't change if I set ascending or descending. It is always ascending.

Thanks
Igor
http://www.somvprahe.sk

Comments

igorik’s picture

I include my views too.

$view = new view;
$view->name = 'velky_blok_diskusie_NEPRIHLASENI';
$view->description = 'diskusie velky blok NEPRIHLASENI';
$view->tag = 'diskusie forum';
$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(
  'title' => array(
    'label' => 'Téma',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 1,
      'max_length' => '59',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'comment_count' => array(
    'label' => 'Reakcie',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'set_precision' => FALSE,
    'precision' => 0,
    'decimal' => '.',
    'separator' => ',',
    'prefix' => '',
    'suffix' => '',
    'exclude' => 0,
    'id' => 'comment_count',
    'table' => 'node_comment_statistics',
    'field' => 'comment_count',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'last_comment_timestamp' => array(
    'label' => 'Dátum',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'date_format' => 'time ago',
    'custom_date_format' => '',
    'exclude' => 0,
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'comment_count' => array(
    'id' => 'comment_count',
    'table' => 'node_comment_statistics',
    'field' => 'comment_count',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'poll' => 'poll',
      'advpoll_ranking' => 'advpoll_ranking',
      'advpoll_binary' => 'advpoll_binary',
      'forum' => 'forum',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
  'last_comment_timestamp' => array(
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('footer', '<div class="more-link"><a  href="http://www.somvprahe.sk/forum">Viac</a></div>');
$handler->override_option('footer_format', '3');
$handler->override_option('footer_empty', 0);
$handler->override_option('use_more', 0);
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'desc',
  'columns' => array(
    'timestamp' => 'timestamp',
    'title' => 'title',
    'comment_count' => 'comment_count',
    'new_comments' => 'new_comments',
    'last_comment_timestamp' => 'last_comment_timestamp',
    'last_updated' => 'last_updated',
  ),
  'info' => array(
    'timestamp' => array(
      'separator' => '',
    ),
    'title' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'comment_count' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'new_comments' => array(
      'separator' => '',
    ),
    'last_comment_timestamp' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'last_updated' => array(
      'sortable' => 0,
      'separator' => '',
    ),
  ),
  'default' => '-1',
));
$handler->override_option('row_options', array(
  'inline' => array(
    'title' => 'title',
    'comment_count' => 'comment_count',
    'timestamp' => 'timestamp',
    'last_comment_name' => 'last_comment_name',
    'last_comment_timestamp' => 'last_comment_timestamp',
    'new_comments' => 'new_comments',
    'last_updated' => 'last_updated',
  ),
  'separator' => '',
));
$handler = $view->new_display('block', 'Blok Diskusie Najnovšie', 'block_1');
$handler->override_option('sorts', array(
  'created' => array(
    'order' => 'DESC',
    'granularity' => 'second',
    'id' => 'created',
    'table' => 'node',
    'field' => 'created',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('block_description', 'diskusie najnovsie velky blok');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('block', 'Blok Najaktuálnejšie (naposledy komentované)', 'block_2');
$handler->override_option('sorts', array(
  'last_comment_timestamp' => array(
    'order' => 'DESC',
    'granularity' => 'minute',
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'poll' => 'poll',
      'advpoll_ranking' => 'advpoll_ranking',
      'advpoll_binary' => 'advpoll_binary',
      'forum' => 'forum',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
  'last_comment_timestamp' => array(
    'operator' => '>=',
    'value' => array(
      'type' => 'offset',
      'value' => '-7 day',
      'min' => '',
      'max' => '',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('footer', '<div class="more-link"><a  href="http://www.somvprahe.sk/forum">Viac diskusií &raquo;</a></div>');
$handler->override_option('items_per_page', 15);
$handler->override_option('block_description', 'diskusie najaktualnejsie velky blok  NEPRIHLASENI');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('block', 'Blok Najviac komentované - celkovo', 'block_3');
$handler->override_option('sorts', array(
  'comment_count' => array(
    'order' => 'DESC',
    'id' => 'comment_count',
    'table' => 'node_comment_statistics',
    'field' => 'comment_count',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);

igorik’s picture

Priority: Normal » Critical

I found that there is in latest dev snapshot broken sorting by user registered date too.

merlinofchaos’s picture

Status: Active » Fixed

Fixed this in -dev. As a workaround, unselect "Override sorts if click sorting is used". Since you're not using clicksorting, this option *shouldn't* matter, but a bug is making it matter.

Status: Fixed » Closed (fixed)

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