Protection when calling _ssp_field for sorting
Protection when calling _ssp_field for sorting
![gboussin](https://secure.gravatar.com/avatar/790a977eddc1e44011b2357707e143d2/?default=https%3A%2F%2Fvanillicon.com%2F790a977eddc1e44011b2357707e143d2_200.png&rating=g&size=120)
Dear all,
When calling _ssp_field, it is necessary to test if the column is searchable or not, or orderable or not, to avoid potential error.
A protection is done in _ssp_filter with the following test:
if ( $http['columns'][$i]['searchable'] == 'true' ) {
in _ssp_sort it is necessary to apply the same kind of protection for orderable
=> I suggest you add in Editor\Editor.php in the method _ssp_sort:
if ( $http['columns'][$order['column']]['orderable'] == 'true' ) {
before calling $query->order( ... _ssp_field ... )
Regards,
Gilles
Answers
Good point - thanks! I'll get the demo script updated.
Allan