From 24ba62ab069c8fc6d5c539474302ceb900702264 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Fri, 24 May 2024 12:52:58 +1200 Subject: [PATCH] FIX Don't emit deprecation warning for calling deprecated methods (#1293) --- code/UserForm.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/UserForm.php b/code/UserForm.php index 2fcffc7..55805dc 100644 --- a/code/UserForm.php +++ b/code/UserForm.php @@ -37,6 +37,7 @@ use SilverStripe\UserForms\Model\Submission\SubmittedForm; use SilverStripe\UserForms\Model\EditableFormField; use SilverStripe\View\Requirements; use SilverStripe\Core\Config\Configurable; +use SilverStripe\Dev\Deprecation; /** * Defines the user defined functionality to be applied to any {@link DataObject} @@ -318,9 +319,11 @@ SQL; $config->addComponent(new BulkManager); } - $sort->setThrowExceptionOnBadDataType(false); - $filter->setThrowExceptionOnBadDataType(false); - $pagination->setThrowExceptionOnBadDataType(false); + Deprecation::withNoReplacement(function () use ($sort, $filter, $pagination) { + $sort->setThrowExceptionOnBadDataType(false); + $filter->setThrowExceptionOnBadDataType(false); + $pagination->setThrowExceptionOnBadDataType(false); + }); // attach every column to the print view form $columns['Created'] = 'Created';