From 208f8fe35b31a4942902811f6561b86ccfc87fb1 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Fri, 9 Jun 2023 12:28:25 -0400 Subject: [PATCH] constructor called in a deprecated way --- Civi/Api4/Generic/BasicBatchAction.php | 3 +++ .../Civi/Api4/Action/MailSettings/TestConnection.php | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Civi/Api4/Generic/BasicBatchAction.php b/Civi/Api4/Generic/BasicBatchAction.php index e9c02e6940..a033602d52 100644 --- a/Civi/Api4/Generic/BasicBatchAction.php +++ b/Civi/Api4/Generic/BasicBatchAction.php @@ -54,6 +54,9 @@ class BasicBatchAction extends AbstractBatchAction { \CRM_Core_Error::deprecatedWarning(__CLASS__ . ' constructor received $doer as 4th param; it should be the 3rd as the $select param has been removed'); } else { + if ($doer && !is_callable($doer)) { + \CRM_Core_Error::deprecatedWarning(__CLASS__ . ' constructor received $doer as a non-callable; the 3rd param as the $select param has been removed'); + } $this->doer = $doer; } } diff --git a/ext/civi_mail/Civi/Api4/Action/MailSettings/TestConnection.php b/ext/civi_mail/Civi/Api4/Action/MailSettings/TestConnection.php index 51076236b6..04822bf373 100644 --- a/ext/civi_mail/Civi/Api4/Action/MailSettings/TestConnection.php +++ b/ext/civi_mail/Civi/Api4/Action/MailSettings/TestConnection.php @@ -15,8 +15,11 @@ use Civi\Api4\Generic\BasicBatchAction; class TestConnection extends BasicBatchAction { - public function __construct($entityName, $actionName) { - parent::__construct($entityName, $actionName, ['id', 'name']); + /** + * @return string[] + */ + protected function getSelect() { + return ['id', 'name']; } /** -- 2.25.1