@@ -530,7 +530,7 @@ protected function saveGridRowSort(GridField $gridField, $data)
530530 //Event to notify the Controller or owner DataObject before list sort
531531 if ($ owner && $ owner instanceof DataObject && method_exists ($ owner , 'onBeforeGridFieldRowSort ' )) {
532532 $ owner ->onBeforeGridFieldRowSort (clone $ items );
533- } else if (Controller::has_curr () && Controller:: curr () instanceof ModelAdmin && method_exists (Controller::curr (), 'onBeforeGridFieldRowSort ' )) {
533+ } else if (Controller::curr () instanceof ModelAdmin && method_exists (Controller::curr (), 'onBeforeGridFieldRowSort ' )) {
534534 Controller::curr ()->onBeforeGridFieldRowSort (clone $ items );
535535 }
536536
@@ -591,7 +591,7 @@ protected function saveGridRowSort(GridField $gridField, $data)
591591 //Event to notify the Controller or owner DataObject after list sort
592592 if ($ owner && $ owner instanceof DataObject && method_exists ($ owner , 'onAfterGridFieldRowSort ' )) {
593593 $ owner ->onAfterGridFieldRowSort (clone $ items );
594- } else if (Controller::has_curr () && Controller:: curr () instanceof ModelAdmin && method_exists (Controller::curr (), 'onAfterGridFieldRowSort ' )) {
594+ } else if (Controller::curr () instanceof ModelAdmin && method_exists (Controller::curr (), 'onAfterGridFieldRowSort ' )) {
595595 Controller::curr ()->onAfterGridFieldRowSort (clone $ items );
596596 }
597597 }
@@ -663,7 +663,7 @@ protected function sortToPage(GridField $gridField, $data)
663663 //Event to notify the Controller or owner DataObject before list sort
664664 if ($ owner && $ owner instanceof DataObject && method_exists ($ owner , 'onBeforeGridFieldPageSort ' )) {
665665 $ owner ->onBeforeGridFieldPageSort (clone $ items );
666- } else if (Controller::has_curr () && Controller:: curr () instanceof ModelAdmin && method_exists (Controller::curr (), 'onBeforeGridFieldPageSort ' )) {
666+ } else if (Controller::curr () instanceof ModelAdmin && method_exists (Controller::curr (), 'onBeforeGridFieldPageSort ' )) {
667667 Controller::curr ()->onBeforeGridFieldPageSort (clone $ items );
668668 }
669669
@@ -780,7 +780,7 @@ protected function sortToPage(GridField $gridField, $data)
780780 //Event to notify the Controller or owner DataObject after list sort
781781 if ($ owner && $ owner instanceof DataObject && method_exists ($ owner , 'onAfterGridFieldPageSort ' )) {
782782 $ owner ->onAfterGridFieldPageSort (clone $ items );
783- } else if (Controller::has_curr () && Controller:: curr () instanceof ModelAdmin && method_exists (Controller::curr (), 'onAfterGridFieldPageSort ' )) {
783+ } else if (Controller::curr () instanceof ModelAdmin && method_exists (Controller::curr (), 'onAfterGridFieldPageSort ' )) {
784784 Controller::curr ()->onAfterGridFieldPageSort (clone $ items );
785785 }
786786 }
0 commit comments