Nested call to api.delete runs twice
A recent change to use an exception has exposed a bug in the api kernal
A unit test is running
$contribution = $this->callAPISuccess('contribution', 'getsingle', array(
'id' => $contribution['id'],
'api.contribution.delete' => 1,
));
However the delete action is being called TWICE - the second time it is failing - looking at the kernal it is run from the respond line as well as the invoke line in the kernel
public function runRequest($apiRequest) {
$this->boot($apiRequest);
$errorScope = \CRM_Core_TemporaryErrorScope::useException();
list($apiProvider, $apiRequest) = $this->resolve($apiRequest);
$this->authorize($apiProvider, $apiRequest);
$apiRequest = $this->prepare($apiProvider, $apiRequest);
$result = $apiProvider->invoke($apiRequest);
return $this->respond($apiProvider, $apiRequest, $result);
}
See And after it returns from invoke
I have been fighting with delete related issues on unit tests in extendedreports - I don't know if they relate