bgultekin / laravel4-datatables-package

Server-side handler of DataTables Jquery Plugin for Laravel 4
267 stars 108 forks source link

Disabled sorting causes invalid index error #132

Closed nesl247 closed 10 years ago

nesl247 commented 10 years ago

In DataTables, if you disable sort via sort: false, errors appear because this package is currently assuming that $this->input['order'] exists.

nesl247 commented 10 years ago

The fix is to change if(count($this->input['order'])>0) to if(array_key_exists('order', $this->input) && count($this->input['order'])>0) on line 448.

ktunkiewicz commented 10 years ago

Fixed with #133 fix

vplanas commented 10 years ago

Hi! Great work here! But I think it's not fixed yet. If ordering is set to false the error still appears:

error: {type:ErrorException, message:Undefined index: order,…}
file: ".../vendor/bllim/datatables/src/Bllim/Datatables/Datatables.php"
line: 498
message: "Undefined index: order"
type: "ErrorException"

The fix proposed by @nesl247 is working

ktunkiewicz commented 10 years ago

OK, i didn't notice that nesl247 is writing about different line than in #133... Merged that change too.

New release with this fix is out now.