Skip to content

Commit 24ba62a

Browse files
FIX Don't emit deprecation warning for calling deprecated methods (#1293)
1 parent 83fafdf commit 24ba62a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

code/UserForm.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
use SilverStripe\UserForms\Model\EditableFormField;
3838
use SilverStripe\View\Requirements;
3939
use SilverStripe\Core\Config\Configurable;
40+
use SilverStripe\Dev\Deprecation;
4041

4142
/**
4243
* Defines the user defined functionality to be applied to any {@link DataObject}
@@ -318,9 +319,11 @@ public function getSubmissionsGridField()
318319
$config->addComponent(new BulkManager);
319320
}
320321

321-
$sort->setThrowExceptionOnBadDataType(false);
322-
$filter->setThrowExceptionOnBadDataType(false);
323-
$pagination->setThrowExceptionOnBadDataType(false);
322+
Deprecation::withNoReplacement(function () use ($sort, $filter, $pagination) {
323+
$sort->setThrowExceptionOnBadDataType(false);
324+
$filter->setThrowExceptionOnBadDataType(false);
325+
$pagination->setThrowExceptionOnBadDataType(false);
326+
});
324327

325328
// attach every column to the print view form
326329
$columns['Created'] = 'Created';

0 commit comments

Comments
 (0)