As discussed with deriene on IRC

1) Create a view with views_handler_field_ncs_last_comment_name (Last comment author)
2) Make style: Table, and Last comment author sortable.
3) Preview view -- works ok.
4) Click on "Last comment author" label -- views tries to add a non existing column.

10x deriene for your help!

Comments

tic2000’s picture

I had the same problem. With the help of merlinofchaos I figured it out.
If you want your field to use click_sort you need to also add this in your field handler too

  function click_sort($order) {
    // Add the order by.
    $this->ensure_my_table();
    $this->query->add_orderby(NULL, NULL, $order, 'alias');
  }

Note that if you don't do this it will brake your view sort handler too if you have one or if you use the default one.

merlinofchaos’s picture

Status: Active » Closed (duplicate)

I posted a duplicate of this a few days ago. http://drupal.org/node/833790 -- that one has a patch, so marking this dup.