Hello
Since my question was not answered as a forum topic I like to open a support request:
I fiddled around some while to set up a default view (modified an export from views and put the code in some module). Everything seems to work but the sorthandler. The fields in the sort array are recognized since I can confirm that e.g. changing 'sortoder' form DESC to ASC effects the output.
But it looks that the handler is not called by the view.
$view->sort = array (
array (
'tablename' => 'biblio',
'field' => 'biblio_year',
'name' => 'Jahr',
'help' => 'Erscheinungsjahr',
'handler' => 'bgv_uheimat_sort_jahr',
'sortorder' => 'DESC',
),
array (
'tablename' => 'biblio',
'field' => 'biblio_number',
'name' => 'nr',
'help' => 'Heft-Nr.',
'handler' => 'bgv_uheimat_sort_heft',
'sortorder' => 'ASC',
),
);
And the handler looks like
function bgv_uheimat_sort_jahr ($op, &$query, $sortinfo, $sort) {
watchdog('bgv',t('in bgv_uheimat_sort_jahr', array()));
$query->add_orderby('biblio', 'biblio_year', 'DESC', 'biblio_biblio_year');
}
Currently installed is views-5.x-1.6.
What do I have to change to get the handler working.
Regards
Comments
Comment #1
esmerel commentedNo real work is going into views 1 at this point, it;'s best to move on to views 2.
Comment #2
schildi commentedNo work at all is done for views 2 on D5 - it simply does not exist.