From: demeritcowboy Date: Fri, 9 Jun 2023 16:28:25 +0000 (-0400) Subject: constructor called in a deprecated way X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=208f8fe35b31a4942902811f6561b86ccfc87fb1;p=civicrm-core.git constructor called in a deprecated way --- 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']; } /**