I have a plugin that is creating a custom field. I am using the modifyUserSortableAttributes
method to make my field appear in the columns available for the Users Table and wanted to be able to sort and filter by this column. The field values is stored as a simple alphanumeric string.
More on hook/method at https://craftcms.com/docs/plugins/hooks-reference#modifyUserSortableAttributes
Call in plugin code is:
public function defineAdditionalUserTableAttributes()
{
return array(
'institution' => "Institution"
);
}
public function modifyUserSortableAttributes(&$attributes)
{
$attributes['institution'] = Craft::t('Institution');
}
However, when I use this method whilst I can add the requisite column to my User table in the admin area and sort the fields alphabetically in ascending order I cannot sort the table by descending order. No errors turning up in the console or site logs. Any suggestions on resolving or debugging greatly appreciated.
Regards,
Cole