UndefinedOffset / SortableGridField

Adds drag and drop functionality to Silverstripe's GridField
BSD 3-Clause "New" or "Revised" License
93 stars 62 forks source link

Wrong sort field type check #99

Closed t3hn0 closed 7 years ago

t3hn0 commented 7 years ago

I'm overloading Int db type and I found a bug. Module is checking if "Int" is subclass of sort field type, but it should check if sort field type is subclass of Int instead :)

Line 193 in /code/forms/GridFieldSortableRows.php: if(!$fieldType || !(strtolower($fieldType) == 'int' || is_subclass_of('Int', $fieldType))) {

should be changed to: if(!$fieldType || !(strtolower($fieldType) == 'int' || is_subclass_of($fieldType, 'Int'))) {

UndefinedOffset commented 7 years ago

Thanks :) fixed, release tag soon