Protection when calling _ssp_field for sorting

Protection when calling _ssp_field for sorting

gboussingboussin Posts: 13Questions: 4Answers: 0
edited March 2019 in Bug reports

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

  • allanallan Posts: 61,627Questions: 1Answers: 10,090 Site admin

    Good point - thanks! I'll get the demo script updated.

    Allan

This discussion has been closed.