From 6233ba43e2b5b5abce319ba5bdc3f0cd3ba61e1d Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 24 May 2019 14:27:23 -0400 Subject: [PATCH] Skip adding default api wrappers to v4 actions --- Civi/API/Subscriber/WrapperAdapter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Civi/API/Subscriber/WrapperAdapter.php b/Civi/API/Subscriber/WrapperAdapter.php index 736aa548bd..f2c3b5f989 100644 --- a/Civi/API/Subscriber/WrapperAdapter.php +++ b/Civi/API/Subscriber/WrapperAdapter.php @@ -97,8 +97,8 @@ class WrapperAdapter implements EventSubscriberInterface { * @return array<\API_Wrapper> */ public function getWrappers($apiRequest) { - if (!isset($apiRequest['wrappers'])) { - $apiRequest['wrappers'] = $this->defaults; + if (!isset($apiRequest['wrappers']) || is_null($apiRequest['wrappers'])) { + $apiRequest['wrappers'] = $apiRequest['version'] < 4 ? $this->defaults : []; \CRM_Utils_Hook::apiWrappers($apiRequest['wrappers'], $apiRequest); } return $apiRequest['wrappers']; -- 2.25.1