Skip to content
Snippets Groups Projects
Unverified Commit 3990fbed authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #14357 from colemanw/api4Wrap

Don't apply api3 pre/post processing to api4 actions
parents 783bb7ec 3635b823
Branches 5.65
Tags 5.65.2
No related merge requests found
......@@ -79,6 +79,9 @@ class TransactionSubscriber implements EventSubscriberInterface {
* @return bool
*/
public function isTransactional($apiProvider, $apiRequest) {
if ($apiRequest['version'] == 4) {
return FALSE;
}
if ($this->isForceRollback($apiProvider, $apiRequest)) {
return TRUE;
}
......@@ -98,6 +101,9 @@ class TransactionSubscriber implements EventSubscriberInterface {
* @return bool
*/
public function isForceRollback($apiProvider, $apiRequest) {
if ($apiRequest['version'] == 4) {
return FALSE;
}
// FIXME: When APIv3 uses better parsing, only one check will be needed.
if (isset($apiRequest['params']['options']['force_rollback'])) {
return \CRM_Utils_String::strtobool($apiRequest['params']['options']['force_rollback']);
......
......@@ -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'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment